From: jonathan@rubis.geop.ubc.ca (Jonathan Thornburg)
Newsgroups: comp.graphics.gnuplot
Subject: aspect ratio (was: Re: symmetric polar plots)
Date: 15 Oct 1992 07:11:30 GMT
Organization: U of Texas at Austin / Physics Dept / Center for Relativity
NNTP-Posting-Host: rubis.astro.ubc.ca
Summary: there needs to be a device-independent way to control aspect ratio
Keywords: gnuplot 3.* plot aspect xsize ysize ratio device independent


Past articles in this thread have raised the problem of how to
make the x and y axes equally scaled in polar-coordinate plots.
I'd like to broaden the scope of this discussion slightly -- I
the need to control aspect ratio can easily arise even without
polar coordinates.  Thus...



Jonathan's Gnuplot gripe / request-for-feature of the day #1:

	There should be a *device-independent* way to
	specify at a minimum the aspect ratio of a plot, and
	ideally the x and y sizes separately.  At the user's
	discretion, she should be able to control these sizes
	either for the "bare" (= not counting the tics/labels
	border area) or the "dressed" (= counting the border
	area) plot.



The desired degree of controls is possible now (Gnuplot 3.0),
*but* in a *very* clumsy and highly device-dependent manner:
	guess initial xsize and ysize parameters
	loop:
		make trial plot with "set size ..., ..." in effect
		measure actual x and y sizes
		   on the output with a ruler
		if (close_enough) break;
		compute corrections
		goto loop;

but this is (to put it mildly) time-consuming, wastefull of paper
and printer lifecycle if the plot is on hard-copy, and requires
redoing the whole manual process if the output format or device
changes.  Moreover, due to the border width, the obvious scalings
of the sizes tend to overcorrect for the bare-plot case.



Further Rationale:
1.	Previous articles in this thread have already outlined
	the bare-plot case when polar coordinates are used.
2.	Even if polar coordinates aren't used, there may still
	be requirements for specified sizes, most commonly for
	equal aspect ratios.  Consider, for example, plotting a
	bunch of points/curves/regions in the complex plane --
	one generally wants the real and imaginary axes on the
	paper to have the same scales.
3.	Sometimes I have to fit a plot or set of plots, including
	the label(s), into an externally imposed page layout.
	The dressed-plot case would be useful for this.
4.	Once my masterpiece is ready, it would be very nice if
	it required only a "set device ..." to use a different
	type of output device.  If the new and old devices work
	on the same paper size (say), I would like to have my plot
	come out the same size (+/- 1/2 pixel or so) without having
	to fiddle with plot size parameters all over again.  Thus
	the x and y size specifications should be able to be given
	in (say) {milli,centi,}meters, inches/feet, attoparsecs,
	points of various Tex/postscript flavors, and other common
	units.  Units of "fraction of maximum size of output device
	in this dimension" would be nice too, for designing plots
	which scale naturally to fill a specified part of the output
	regardless of the device used.  (The existing "set size"
	gives the latter, "relative", units.)




- Jonathan Thornburg
  <jonathan@geop.ubc.ca> through mid-November 92, then
  <jonathan@einstein.ph.utexas.edu> or <jonathan@hermes.chpc.utexas.edu>
  [for a few more months] UBC / {Astronomy,Physics}
  [then through Aug/92] U of Texas at Austin / Physics Dept
					     / Center for Relativity
Newsgroups: comp.graphics.gnuplot