axis aspect ratio

Hello everyone,

I’m using matplotlib for plotting data results from numerical simulations that involve a lot of geometric calculations.

I did read the tutorial, but I haven’t been able to figure out the proper way to set the axis aspect ratio to “1” when

numerical data is plotted.

Here is an example of my plot:

http://img715.imageshack.us/img715/9318/projections.png

since I need the aspect ratio to be “1” so that I can visually inspect my numerical code for bugs, I would really

appreciate the help.

I’ve loaded the data using pylab.load and I’ve plotted the files without using figure or axes, just plain old

pyplot.

Give this a shot:

import matplotlib.pyplot as plt

fig = pl.figure(figsize=(4,4))

ax = fig.add_sublot(1,1,1) # tweak as needed

[plot your data]

ax.set_aspect(‘equal’)

http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_aspect#matplotlib.axes.Axes.set_aspect

From:
tomislav_maric@…2537… [mailto:tomislav.maric@…2537…]
AM
To:
matplotlib-users@lists.sourceforge.net
aspect ratio

Hello everyone,

I’m using matplotlib
for plotting data results from numerical simulations that involve a lot of
geometric calculations.

I did read the
tutorial, but I haven’t been able to figure out the proper way to set the axis
aspect ratio to “1” when

numerical data is
plotted.

Here is an example
of my plot:

http://img715.imageshack.us/img715/9318/projections.png

since I need the
aspect ratio to be “1” so that I can visually inspect my numerical
code for bugs, I would really

appreciate the help.

I’ve loaded the data
using pylab.load and I’ve plotted the files without using figure or axes, just
plain old

pyplot.

···

Sent: Monday, March 15, 2010 9:33
Subject: [Matplotlib-users] axis