| 
     
      
      
      From: Benjamin R. <ben...@ou...> - 2011-09-30 15:18:53
      
     
   | 
On Thu, Sep 29, 2011 at 4:31 PM, Holger Brandsmeier < hol...@sa...> wrote: > Hi Ben, > > in your example > > http://matplotlib.sourceforge.net/examples/mplot3d/polys3d_demo.html > the essential line is: > ax.add_collection3d(poly, zs=zs, zdir='y') > according to everything I see this can only draw something that is > made out of several axes parallel parts. I don't think how with such a > command you could end up with some picture like: > > http://matplotlib.sourceforge.net/plot_directive/mpl_examples/mplot3d/surface3d_demo.hires.png That is correct. It is only for simple conversions. > > What I want to plot should look like that picture (with is part of > your gallery), just that I don't have a meshgrid data underlying. > > That is why you have to work with the 3D objects from mpl_toolkits.mplot3d.art3d directly. There isn't a lot of documentation, so your best bet is to look at the source code of the module. > Your second example seems to have the same limitation > http://matplotlib.sourceforge.net/examples/mplot3d/pathpatch3d_demo.html > just it works with the command > art3d.pathpatch_2d_to_3d(p, z=0, zdir="x") > > The only way that I currently see is that I call > ax.plot_surface() > for each quadrilateral of my mesh. > > That would be overkill. However, try checking out the source code for plot_surface() to see how it creates its Poly3DCollection object. Ben Root  |