## Re: [Matplotlib-users] 3D - aspect ratios

 Re: [Matplotlib-users] 3D - aspect ratios From: Benjamin Root - 2011-10-26 14:07:14 Attachments: Message as HTML ```On Tuesday, October 25, 2011, Dylan Temple wrote: > Mr. Root, > > Thank you! That got the aspect ratio between the axes to be what I needed. I had one more question, however, when this aspect ratio is set the actual plot is very small (it shrinks the y and z axes significantly, obviously) however, I want to zoom in so that there as little unused space within the axes instance as I can (currrently most of it is just unused white space and the actual surface is plotted at the bottom). I have been trying to set the ax.dist property, however, this does not seem to have the effect I need. Is there some kind of method to set an initial zoom factor, I have been searching and cannot find one. Thank you again for your help! > > Dylan Temple > Dylan, This might be more an issue about the axes limits, but I am not sure. Could you post an image of your plot so that I can see your problem? Also, what values are you using for pbaspect? Ben Root ```

 [Matplotlib-users] 3D - aspect ratios From: Dylan Temple - 2011-10-25 17:04:20 ```Matplotlib users, Hello, I am currently trying to create a 3D plot of a ships hull using the plot_surface command in an instance of Axes3d. The default aspect ratio for the surface_plot is a cube which, obviously, makes a silly looking ship. The x-axis ranges from 0-150, the yaxis ranges from -10,10 and the z-axis ranges from 0-10. I want to retain the aspect ratios of those data sets in the plot (to get the long, slender ship-looking surface). I can get the z and x axes to match up by doing something like: aspect = (len(xaxis)/len(zaxis))**-1 ax.set_aspect(aspect,'datalim') However, I can not find a way to get different aspect ratios between axis to get each one in scale with the three data sets. Is there a way to do this currently with the Axes3d objects? Thank you for your help, Dylan -- Dylan Temple Ph.D Student, University of Michigan, NA&ME Department Email: dylantem@... Phone: 607-592-1749 ```
 Re: [Matplotlib-users] 3D - aspect ratios From: Benjamin Root - 2011-10-25 17:22:00 Attachments: Message as HTML ```On Tue, Oct 25, 2011 at 12:04 PM, Dylan Temple wrote: > > Matplotlib users, > > Hello, I am currently trying to create a 3D plot of a ships hull using the > plot_surface command in an instance of Axes3d. The default aspect ratio > for the surface_plot is a cube which, obviously, makes a silly looking > ship. The x-axis ranges from 0-150, the yaxis ranges from -10,10 and the > z-axis ranges from 0-10. I want to retain the aspect ratios of those data > sets in the plot (to get the long, slender ship-looking surface). I can > get the z and x axes to match up by doing something like: > > aspect = (len(xaxis)/len(zaxis))**-1 > ax.set_aspect(aspect,'datalim') > > However, I can not find a way to get different aspect ratios between axis > to get each one in scale with the three data sets. Is there a way to do > this currently with the Axes3d objects? > > Thank you for your help, > Dylan > > Dylan, It is a feature I have worked on a bit, but haven't fully completed. Check out this thread: http://comments.gmane.org/gmane.comp.python.matplotlib.general/27415 I should see if I can rebase that branch on the updates I have made to mplot3d since then. I hope this helps! Ben Root ```
 Re: [Matplotlib-users] 3D - aspect ratios From: Benjamin Root - 2011-10-26 14:07:14 Attachments: Message as HTML ```On Tuesday, October 25, 2011, Dylan Temple wrote: > Mr. Root, > > Thank you! That got the aspect ratio between the axes to be what I needed. I had one more question, however, when this aspect ratio is set the actual plot is very small (it shrinks the y and z axes significantly, obviously) however, I want to zoom in so that there as little unused space within the axes instance as I can (currrently most of it is just unused white space and the actual surface is plotted at the bottom). I have been trying to set the ax.dist property, however, this does not seem to have the effect I need. Is there some kind of method to set an initial zoom factor, I have been searching and cannot find one. Thank you again for your help! > > Dylan Temple > Dylan, This might be more an issue about the axes limits, but I am not sure. Could you post an image of your plot so that I can see your problem? Also, what values are you using for pbaspect? Ben Root ```