How do i scale my axes in matplotlib?

E

Eric Holbrook

I'm using matplotlib to generate (and save) plots of bandwidth data
from simulation logs. Since the simulations are of varying lengths, i
need a way to scale the axes so that every 100,000 points on the
X-axis are roughly equal to the height of the Y-axis. In other words,
if my X data varied from 0 to 575,000, my aspect ratio would be
roughly 6:1. If X goes from 200,000 to 400,000, then the aspect ratio
should be 2:1.

I've looked through the manuals, but i can't find out how to do
this. The 'axis' and 'axes' methods looked promising, but don't seem
to let me set an aspect ratio of the axes. Anyone know how to do this?

tia,
Eric
 
E

Emmanuel

I'm using matplotlib to generate (and save) plots of bandwidth data
from simulation logs. Since the simulations are of varying lengths, i
need a way to scale the axes so that every 100,000 points on the
X-axis are roughly equal to the height of the Y-axis. In other words,
if my X data varied from 0 to 575,000, my aspect ratio would be
roughly 6:1. If X goes from 200,000 to 400,000, then the aspect ratio
should be 2:1.

I've looked through the manuals, but i can't find out how to do
this. The 'axis' and 'axes' methods looked promising, but don't seem
to let me set an aspect ratio of the axes. Anyone know how to do this?

tia,
Eric

You should look at the matplotlib examples :
There is one called "equal_aspect_ratio.py"

http://matplotlib.sourceforge.net/matplotlib_examples_0.91.2svn.zip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top