So this is almost a feature request. The only problem is
> that gnuplot's size command does not seem obviously suited
> to the matplotlib.matlab model, and I'm not sure what a good
> version would be. I think it would be something like "get
> the current axis, keep the "long" axis (as implied by the
> ratio) full length, and "shrink" the shorter axis as
> necessary to achieve the right ratio. This would respect
> the existing margins to everywhere except by the shrinking
> axis. However it would probably be better to adjust the
> 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