I am wondering if there is a way to generate 2d contour plots from a set of 3D data points using either python or matlab? The 3D data points create a roughly spherical shape and the contour would represent the outer border of this spheroid on different planes angled from 0 to 180 degrees
I am thinking one way is to generate a 3D surface from the pointcloud by using numpy.meshgrid and then using plot_surface. However, I also do not find a way to take angled slices out of the interpolated 3D data to obtain a contour.
Ideas very welcome!
thanks
Jesse
Related
I have the coordinates of four 3D points bounding a 3d plane representing a wall. I want to create a 3D object of that plane using python. Red points shown in figure are the boundaries of the plane, while green points are boundaries of voids in the plane. Any help by a simple code or name of a library or a method?
PS: The shown figure is a mesh but I want a planar surface something like that
I have used the skimage find_contours on some velocity data but I am struggling to work out how to replot the contour outline onto a longitude latitude grid ?
I think it is some sort of transform in coordinates but I am struggling to work out how.
So I am a bit new to python and having a little trouble.
I am attempting to plot (project) a 3d data set onto an arbitrary plane. I can of course plot xy etc. but since my data has a particular orientation (all the points fall into an arbitrary orientated cylinder) I want project all the points onto a plane that slices that cylinder orthogonally and that plane would have a arbitrary orientation.
I am working with microseismic data if anyone is familiar with that and all the points are located around a wellbore with follows an arbitrary but fairly straight azimuth.
The data is in Cartesian coordinates.
I have a 3D regular grid of data. I would like to write a routine allowing the user to specify a plane slicing through the data with arbitrary orientation and returning a contour plot of the data in the plane. Is there a ready-made way in matplotlib to do this? Could find anything in the docs.
You can use roll function of numpy to rotate your plane and make it parallel with a base plane. now you can choose your plane and plot. Only problem is that at close to edges the value from one side will be added to opposite side.
I am attempting to do something similar to this:
sample ozone profile
Not necessarily over an orthographic projection - a cube over a map would suffice.
I'm able to plot the PolyCollection object produced by matplotlib.pyplot.pcolor, but cannot figure out if there's an accepted way of plotting the profile over an arbitrary lat/lon path.
The only thing I can think of right now is continuing to use pcolor() to get the face colors, then just modifying the vertices for each Poly object.
If you want to create a 3D projection, then you may use the plot_surface. It essentially draws a 2D array where the 3D coordinates of each vertex is given.
You might get some ideas by looking at this: Creating intersecting images in matplotlib with imshow or other function
The matplotlib solution there is essentially the same as using pcolor, but the 3D arithmetics is carried out by matplotlib. The suggestion to use mayavi is also something worth conisdering, as matplotlib is not at its strongest with 3D projected raster data.