473,480 Members | 2,123 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4630
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1751
by: John Hunter | last post by:
matplotlib is a 2D plotting package for python with a matlab compatible syntax and output tested under linux and windows platforms. matplotlib-0.30 is available for download at...
2
3306
by: monkeyboy | last post by:
Hello, I'm searching for a plotting package that will allow multiple y axes of different scales. For example I'd like to overlay 4 or 5 time series with each series having a separate axis. Does...
5
11888
by: John Henry | last post by:
I've been asking this question at the matplotlib user list and never gotten an answer. I am hoping that there are matplotlib users here that can help. My problem with matplotlib's way of...
3
4697
by: vajratkarviraj | last post by:
i hav python2.5, matplotlib0.90.1, and py2exe for python 2.5 all on windows xp... i hav a python program(letsc.py) which uses the matplotlib package... and i want 2 make an exe of it for distribution...
0
1773
by: Rominsky | last post by:
I am trying to use the fill command to draw a box around an object in an image. I can get the box drawn, but there seems to be a side effect. The fill command is adding white lines to the top and...
4
9646
by: John Henry | last post by:
Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3)? I am getting a: RuntimeError: Could not find the matplotlib data files when...
0
4310
by: PamMish1982 | last post by:
Hi all, I have recently started using Python and I am trying to make a GUI out of Tkinter. I am using matplotlib for the graphic purposes. I have to make a exe file from this code. I use py2exe...
2
6237
by: DaveD170 | last post by:
Hi everybody, I'm newbie in c# and I'm having trouble in creating an excel chart. I have vector of data that my program calculated. It's in the next format: X Y 0.1 100 0.2 90...
3
5230
by: afrogazer | last post by:
I am creating a wind rose using a polar bar plot bu the points do not seem to align to the correct angles. Here is the sample code I am using. I can't seem to see anything in the API on how to set...
0
7050
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6743
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.