## [Matplotlib-users] Sampling a 3D plane to 2D data

 [Matplotlib-users] Sampling a 3D plane to 2D data From: Christoph Piefke - 2012-01-31 06:35:57 ```Hello everybody, I have a problem transferring from 3D data to a 2D representation. I used mayavi to define a cut plane through a volume data set and got the xyz coordinates for the points on the plane and the data at each point. Now I would like to make a contour plot of that data in matplotlib. My first try was rotating the normal of the cut plane parallel to the z-axes and leaving the data unchanged. Unfortunately, this changed the number of grid points, so I do not know how to fit these both sets together. Is there a convenient way how to sample these 3d data and put it on a 2d grid? Thank you very much in advance, Chris ```

 [Matplotlib-users] Sampling a 3D plane to 2D data From: Christoph Piefke - 2012-01-31 06:35:57 ```Hello everybody, I have a problem transferring from 3D data to a 2D representation. I used mayavi to define a cut plane through a volume data set and got the xyz coordinates for the points on the plane and the data at each point. Now I would like to make a contour plot of that data in matplotlib. My first try was rotating the normal of the cut plane parallel to the z-axes and leaving the data unchanged. Unfortunately, this changed the number of grid points, so I do not know how to fit these both sets together. Is there a convenient way how to sample these 3d data and put it on a 2d grid? Thank you very much in advance, Chris ```
 Re: [Matplotlib-users] Sampling a 3D plane to 2D data From: Benjamin Root - 2012-02-01 19:41:51 Attachments: cntr3d.py Message as HTML ```On Tue, Jan 31, 2012 at 12:19 AM, Christoph Piefke < anmeldung@...> wrote: > Hello everybody, > > I have a problem transferring from 3D data to a 2D representation. > I used mayavi to define a cut plane through a volume data set and got > the xyz > coordinates for the points on the plane and the data at each point. > > Now I would like to make a contour plot of that data in matplotlib. > > My first try was rotating the normal of the cut plane parallel to the > z-axes and leaving the data unchanged. > Unfortunately, this changed the number of grid points, so I do not know > how to fit these both sets together. > > Is there a convenient way how to sample these 3d data and put it on a 2d > grid? > > Thank you very much in advance, Chris > > I have attached an example that was provided by a fellow user recently that might be of use. I am seeing how to either modify it to include it into mplot3d or to at least include it in the gallary examples. I hope it is helpful to you! Ben Root ```