On 2007-08-15 21:41-0400 Hazen Babcock wrote:
> On Aug 8, 2007, at 5:27 PM, Alan W. Irwin wrote:
>> (5) pscairo ignores the -portrait flag and the -ori flag gives strange
>> looking results with part of the plot (the titles) oriented to a new
>> direction and the rest of the plot ignoring -ori altogether.
> It looks like the ps driver supports this option but the xwin driver does
> not. Should all of the cairo drivers have a portrait option? Or is this only
> considered useful for file devices?
Actually, I think it is only relevant to devices such as
pscairo (and possibly pdfcairo?) which are historically related to paper
output. I guess some LCD display devices have a portrait mode as well
(where the whole LCD is twisted by 90 degrees to make it tall and skinny).
> When you create a plot in portrait mode with the ps driver the x and y pages
> sizes are not interchanged so the plot comes out looking a little strange,
> i.e. somewhat tall and narrow. Is this the "Right Thing To Do"?
Yes, that is the whole point. The usual postscript landscape mode that
PLplot produces is good for plots which need more space in the X direction,
and all our examples are designed with that constraint in mind. But suppose
you reorganize example 1 (say) so that the four subplots are stacked in a
vertical column so you need more Y space than X space. (For my research
plot that needs portrait mode, my subplots on the page are stacked in just
such a vertical column.) Then portrait mode (by definition tall and narrow)
gives best results for that tall and narrow case. But I do agree that our
landscape examples do look badly proportioned (just as expected) in portrait
> Or should
> portrait mode simply be a 90 degree rotation of the plot?
That is part of it as you can see from ps.c, but you also need to
set pls->freeaspect = 1; which acts the same as if the user had specified
-freeaspect on the command line.
I suggest you get the -ori option working first (so plotted results rotate
Once -ori 0, -ori 1, -ori 2, etc., work, then for fun try -ori 0.3 (i.e.,
non-integer -ori values). You will find a long-standing PLplot bug for that
case which doesn't give correct plotted results (the rectangular viewport
gets sheared into a parallogram) for non-integer -ori values if the aspect
ratio is different from unity. Since the problem disappears for a unity
aspect ratio, I think the x length is being taken rather then the
appropriate y length or vice versa somewhere deep in the rotation code. But
nobody has ever been able to track down the incorrect logic (which is, of
course, a very low priority since integer -ori values are the ones that tend
to be used).
Once -ori works for integer values, then you should confirm that the -a
option works as well. In other words, your device should give correct
results for different aspect ratios passed to the device from the core
PLplot library. After that confirmation, portrait mode should be a snap
since pls->freeaspect = 1 tells the PLplot core library to adjust the aspect
ratio appropriately (i.e., tall and skinny) for portrait mode.
I hope I have clarified things for you.
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project