From: John H. <jdh...@ac...> - 2004-09-13 14:25:03
|
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes: Alan> So this is almost a feature request. The only problem is Alan> that gnuplot's size command does not seem obviously suited Alan> to the matplotlib.matlab model, and I'm not sure what a good Alan> version would be. I think it would be something like "get Alan> the current axis, keep the "long" axis (as implied by the Alan> ratio) full length, and "shrink" the shorter axis as Alan> necessary to achieve the right ratio. This would respect Alan> the existing margins to everywhere except by the shrinking Alan> axis. However it would probably be better to adjust the Alan> figure size as well, to keep the margins unchanged. I'm not fully understanding you, in part because I find the terminology ambiguous. Could you give an example of what you want to achieve (eg a scatterplot with a square viewing window). For concreteness, we have ylim / xlim : the data view limits axh / axw : the axes height / width, relative coords 0-1 figh / figw : the figure width and height in inches dpiy / dpix : the display devices resolution in pixels in the vertical and horizontal directions In order to get true physical sizes and ratios, we need to know dpiy and dpix. matplotlib currently only supports a single dpi, though it is still possible to hack true sizes by adjusting for example, figh and figw to compensate for variation in dpiy and dpix. It is certainly possible to provide some helper functions to create a properly sized and scaled figure and axes with a desired aspect ratio or physical size. JDH |