From: John H. <jdh...@ac...> - 2004-03-08 21:35:39
|
>>>>> "Al" == Al Schapira <a.d...@wo...> writes: Al> In order to get the size of the overall plot window to Al> anywhere near full screen, I've had to use something like Al> figure(1, figsize=(18,12), dpi=72) or figure(1, Al> figsize=(9,6), dpi=144) Al> Both produce the same overall size plot window (11.25" wide by Al> 8" tall), but in the latter case, the text size is much larger Al> than in the latter case. Likewise the linewidths. Al> Can you please explain the interaction among the dpi value, Al> the font sizes displayed, and the overall plot size. Hi Al, This is a complicated issue and I don't have a full answer for you. The problem is compounded by the fact that I am trying to make the DPI parameter produce figures that look the same across the backends, and different backends have often have an additional parameter that makes assumptions about the number of pixels per inch on your display - eg gd assumes 96, and these are not under my control. The total figure width in pixels is figure width in inches * dpi; ditto for height. If you set dpi to your device PIXELS_PER_INCH, the width should be correct if you measure it on the screen with a ruler. You will probably need to set PIXELS_PER_INCH for the backend you are using to be correct for your display. This is a parameter the respective backend files, eg, in matplotlib/backends/backend_gtk.py. For backend_agg, you will have to change it both in src/_backend_agg.cpp and matplotlib/backends/backend_agg.py. This is something I would like to rationalize and perhaps move to the rc file. I suggest setting it to your display width / pixels width, eg, 116 in your example. Then figure( (8,6), dpi=116) should produce a an 8 inch by 6 inch figure. Let me know. Then default dpi can be set in the rc file. None of this matters, of course, for PS, which is resolution independent. dpi is not really suitably named because of this additional parameter PIXELS_PER_INCH. dpi is really a resolution parameter. When you increase dpi, the relative sizes of everything in your image should increase proportionately (line widths, text sizes, etc) but you have more pixels of resolution. When you increase figure size for a give dpi, everything should appear smaller because the physical size of the objects in your canvas haven't changed, but your canvas has increased. I'm open to suggestions on how to make this better. JDH |