plot(3,5) vs. non-square plot areas

Dick Dunn rcd at opus.UUCP
Wed Nov 28 19:41:13 AEST 1984


> In the course of some work on our plot(5) filter for the HP 7470A plotter,
> we ran across an interesting question:  just what does it mean if you ask
> plot(3) for a non-square space?  There are two possible interpretations:
> 
> 	1. The viewport (physical plot area) remains square, and the
> 		coordinate scaling is not the same in X and Y.
> 
> 	2. The viewport is as large as it can be, within the available
> 		physical space, while preserving the aspect ratio of
> 		the space() request.  So the X and Y scales are the same.
> 
> The Bell documentation strongly implies interpretation (1), and that's
> what their plot(5) code seems to do...

I've been faced with this one (and worse, but more of that in a minute).
At the outset, it's just as well to admit that the definition of plot(5)
doesn't really address the scaling question very well and it might be
better just to choose a different interface and be done with it.

The manual is quite clear on the point that "the plotting area is taken to
be square" in "every case"--so if you stay with the plot(5) definitions you
probably ought to follow that.

> ...The
> Bell graphics software we've examined invariably uses square spaces, so it
> would be unaffected.

But you may find other software (i.e., plot(5) but non-Bell) which relies
on using differing X and Y scales to get a non-square mapping.  If you want
compatibility, you need to preserve the definitions; if you don't need the
compatibility, why not use a better interface definition?

Incidentally, there are devices which have non-square (rectangular)
pixels--I wrote a plot driver for a Printronix printer, which has 1/60 "
horizontally by 1/72 " vertically.  Now, in the context of the definition
of plot(5), what is meant by the "unity mapping" of a square region?  If I
map 1-1 to pixels, I have X and Y ranges which differ whether I use the
full rectangular page or a square subregion.

And don't forget the definition of circle and arc.  How should those behave
if the scaling doesn't come out equal in X and Y on the physical surface?
It would seem that an arc would always lie on the circle drawn with
corresponding parameters--yet unless the arc crosses the axis (presumably
X) on which the radius is interpreted, there may be no point on the arc
which lies at a true distance of the radius from the center!
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Reality?  Gad, that's worse than puberty!



More information about the Comp.unix.wizards mailing list