471,330 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

How do i scale my axes in matplotlib?

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
Dec 22 '07 #1
1 4529
On Dec 22, 5:42 pm, Eric Holbrook <eholbr...@austin.rr.comwrote:
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/ma..._0.91.2svn.zip
Dec 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by John Hunter | last post: by
2 posts views Thread by monkeyboy | last post: by
5 posts views Thread by John Henry | last post: by
reply views Thread by Rominsky | last post: by
4 posts views Thread by John Henry | last post: by
2 posts views Thread by DaveD170 | last post: by
3 posts views Thread by afrogazer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.