3D - aspect ratios

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@...243...
Phone: 607-592-1749

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

···

On Tue, Oct 25, 2011 at 12:04 PM, Dylan Temple <dylantem@…3829…> 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