question about figsize keyword of figure(..)

I'm confused about what

matplotlib.pyplot.figure(figsize = (a,b)) *means*

It appears that the figure gets *bigger* as I make a and b *smaller* !??!

Chris

chris@...1388... wrote:

I'm confused about what

matplotlib.pyplot.figure(figsize = (a,b)) *means*

a and b are width and height in inches. For vector backends (svg, ps, pdf), that's all there is to it--unless there is a bug. For non-vector output (screen, *.png), the a, b get translated to pixels based on the figure.dpi (if to the screen) or the savefig.dpi (if to a file). If you display such a file on the screen, or print it, the size will depend on the software used for that display or printing, and this is completely out of mpl's control.

(Actually, even for vector output, what you see upon display will depend on the software used for display--acroread, evince, gs, ghostview, etc.--and on how it is configured. But at least the vector output formats specify physical sizes in real units, not arbitrary pixels.)

It appears that the figure gets *bigger* as I make a and b *smaller* !??!

You will need to be more explicit about what you are doing to reach this conclusion.

Eric

···

Chris

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

What he is probably seeing comes from the fact that some of the figure
elements (line width, font size) are in physical dimensions. As you
make the figure size smaller with figsize, these dimensions are
unchanged, and so they look bigger in proportion to things that scale
proportionately with the figsize, eg the axes area. There is not
built-in scaling of these physical dimensions with figsize.

JDH

···

On Mon, Oct 27, 2008 at 6:48 PM, Eric Firing <efiring@...202...> wrote:

It appears that the figure gets *bigger* as I make a and b *smaller* !??!

You will need to be more explicit about what you are doing to reach this
conclusion.