0

I have some x, y, z data for which I can plot multiple 3d lines/traces into order to build the following image:

enter image description here

The python code building this is like so:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(figsize=[20, 20])
ax = fig.add_subplot(111, projection='3d')

midpoint = len(t)/2 - 10000

for i in range(100):
    x = xs_array[i]
    y = ys_array[i]
    ax.plot(t[midpoint:midpoint+20000], x[midpoint:midpoint+20000], y[midpoint:midpoint+20000], alpha=0.4)

I want to build a isosurface like the one shown below as it is hard to interpret the shape in the current form, how might I go about that?

enter image description here

SomeRandomPhysicist
  • 1,531
  • 4
  • 19
  • 42
  • 2
    Did you checkout this question? https://stackoverflow.com/questions/6030098/how-to-display-a-3d-plot-of-a-3d-array-isosurface-in-matplotlib-mplot3d-or-simil – Jurgy Oct 11 '17 at 14:56
  • I hadn't seen that, it looks like what I want to achieve though. How would this work in my case? This person appears to have x, y, z and then s (a function of x, y and z). In my case I just have x, y and z coordinates of the points I wish to make into an isosurface. – SomeRandomPhysicist Oct 11 '17 at 15:00
  • would I have to bin the number of counts in some 3d x, y, z cubes in order to use this? – SomeRandomPhysicist Oct 11 '17 at 15:05
  • An isosurface is a surface along which some quantity is constant (=iso). What would be the constant quantity here? Could it be that you don't acutally want an isosurface but something different? – ImportanceOfBeingErnest Oct 11 '17 at 15:27
  • I guess I want to plot an isosurface of the population density, so I'd need to quantify that on the 3d grid – SomeRandomPhysicist Oct 11 '17 at 16:18

0 Answers0