[Thread Prev][Thread Next][Index]

Re: Using viewports, margins, &c...

Complex viewport layout ...

Hi Gary,

I have gotten behind on my Email ... finally catching up.

The requirements for preserving size and aspect ratio of plots in
viewports of various size and aspect ratio is an over-determined
problem. There is no automated approach that works "best" in all cases.

The philosophy adopted by Ferret is that each viewport is regarded as a
separate output window, and the aspect ratio is adjusted for the
viewport exactly as it would be for a separate output window.

It sounds like in your case you have a collection of scripts (or
commands) for creating various plots, and those plots use differing
aspect ratios. You want to preserve those aspect ratios as you pull the
plots together into a multi-viewport page.

Using the pre-defined quadrant viewports UL, UR, LL, LR, is probably not
the best way to go in this case, since that approach implicitly assumes
that all viewports have the same aspect ratio and sizing. Instead,
you'll want to define new viewports, each with the appropriate aspect
ratio and size (equivalent to the
SET WINDOW/ASPECT=xxx you used on the full-window plots).

This will involve a calculation of the lo:hi arguments to
but it should not require an iterative approach. The values of the
arguments can be calculated from size and aspect information.
Furthermore, you can use the Ferret "immediate mode" expressions to
calculate the arguments for you, automatically, as part of the DEFINE
VIEWPORT command. You'll also want to use the /TEXT=yyy argument; simply
use the same value for all of your viewports, to make sure they are all
scaled identically. The particular value you choose will subtly
influence the plot appearance -- choose a value that suits poersonal

If you send me particulars of your layout, I'll be happy to illustrate
this approach.

	- steve


Gary Strand wrote:
> I'm trying to plot two fields, in a total of four viewports, XY slabs on the
> left, top and bottom, and zonal averages on the right, top and bottom. I've
> been playing with defining viewports and using "margins.jnl", and it's get-
> ting a wee bit tedious trying to match up the heights of the zonal averages
> with the slabs, and, trying to make sure the aspect ratio of the slabs is
> correct.
> Any hints out there other than iteration?
> I do have a beef with viewports, though - if I'm looking at a 360 degree by
> 180 degree plot, i.e., global, why does changing the viewport mess up the
> aspect ratio? Is there some way to force FERRET not to change it?
> Thanks!
> --
> Gary Strand
> strandwg@ucar.edu                              http://www.cgd.ucar.edu/ccr/gary

Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement