SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Andrew S. <str...@as...> - 2004年10月17日 20:59:52
Hi All,
I get what I consider to be a bug. (I think) the following code should 
produce a 10 row, 6 column figure with identical plots. However, this 
code (with current CVS matplotlib), displays a 10 row, 6 column figure 
with plots of apparently varying x and y limits...
Even adding "set(gca(),'xlim',(1,3)); set(gca(),'ylim',(4,6))" does not 
help.
Am I confused, or is this a bug?
Cheers!
Andrew
#!/usr/bin/env python
from matplotlib.matlab import *
n_rows = 10
n_cols = 6
row_height = 1.0/n_rows
col_width = 1.0/n_cols
figure()
for row in range(n_rows):
 for col in range(n_cols):
 axes([ col*col_width, row*row_height,
 (col+1)*col_width, (row+1)*row_height ])
 plot([1,2,3],[4,5,6])
show()
From: Andrew S. <str...@as...> - 2004年10月17日 21:02:41
Arrg!
OK, reading the docstring for axes, I find out that the 3rd and 4th 
argument are width and height, (not right and top). This all works 
fine. I was confused...
Cheers!
Andrew
Andrew Straw wrote:
> Hi All,
>
> I get what I consider to be a bug. (I think) the following code 
> should produce a 10 row, 6 column figure with identical plots. 
> However, this code (with current CVS matplotlib), displays a 10 row, 6 
> column figure with plots of apparently varying x and y limits...
>
> Even adding "set(gca(),'xlim',(1,3)); set(gca(),'ylim',(4,6))" does 
> not help.
>
> Am I confused, or is this a bug?
>
> Cheers!
> Andrew
>
> #!/usr/bin/env python
>
> from matplotlib.matlab import *
>
> n_rows = 10
> n_cols = 6
>
> row_height = 1.0/n_rows
> col_width = 1.0/n_cols
>
> figure()
> for row in range(n_rows):
> for col in range(n_cols):
> axes([ col*col_width, row*row_height,
> (col+1)*col_width, (row+1)*row_height ])
> plot([1,2,3],[4,5,6])
> show()
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out 
> more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /