Re: gsnPanelBottom values

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 28 Nov 2006 22:49:16 -0700

Hi Dave,

I will try to explain the weird behavior of gsn_panel and the usage
of the gsnPanelBottom/Top/Etc resources, in conjunction with maximizing
the series of plots in the frame.

For starters, it's important to note that once you maximize a plot or a
series of
plots in a frame, especially when you are dealing with a non-square
device like a piece of paper, then the NDC coordinate space is pretty
thrown out the door. That is, the original NDC unit square that the
plot(s) were drawn
in may actually bigger than the piece of paper that the plots are drawn
in. This
is necessary in order to maximize the plots on the frame. Think of it
as taking a square,
and making it bigger (without skewing the aspect ratio) so that
everything drawn
inside the square is still on the piece of paper. So, if the plot
inside the NDC square
is pretty small, you could end up making the square quite a bit bigger
until the
plot is just big enough to completely fit on the piece of paper. Also,
if the plot
is wider than it is high, this is when it gets automatically rotated to
mode so that it can fit on the paper even better.

What this all means is that when you use gsn_text_ndc to place text on
a plot
that's been maximized, the NDC coordinates don't really mean anything
your square may actually be bigger than the piece of paper at this
point. This means
the bottom of the plots may be at some NDC value like 0.30, rather than
very close
to the edge at 0.05.

In your case, you are drawing a series of plots that are wider than
they are high.
Thus, before the maximization takes place, you actually end up with
plenty of
white space below and above the plots. In fact, if you set
resPanel_at_gsnDebug = True,
gsn_panel will print out all the NDC values for each plot, and it will
also print a
final summary of the minimum and maximum NDC locations of the topmost,
leftmost, rightmost, and bottommost locations of your plots. With your
plots, the
bottommost plot is at y=0.30 NDC value. The labelbar is just under
this, probably
at about an NDC value of 0.2. Thus, to place text below the labelbar,
should try a value of 0.1 for starters, instead of 0.03.

You only need to use the gsnPanelBottom/gsnPanelTop/etc resources if
the original
NDC square that your plots are drawn in actually leave no room for
additional text
to be drawn. Once you set any of these resources, the maximization
procedure will
not allow this part of the square to fall outside of the paper, because
it assumes that you have something drawn in that part of the square.
This is
why you saw so much white space between your labelbar and your text:
the bottom
of your plots were at 0.30, and with gsnPanelBottom being set to
0.0005, you were seeing
all the white space between 0.0005 and 0.30.

Since you have plenty of NDC space to put text below your labelbar, you
even bother with gsnPanelBottom. Just try an NDC Y value of 0.1:

     gsn_text_ndc(pswks, TimeDate, 0.5, 0.1, txres)

I wish I had an easier way of explaining this. I thought about trying
to draw a picture
to show a series of examples on how maximization works. I will continue
to think about
whether there's a reasonable way to show this.


P.S. You have gsnPaperOrientation set to "horizontal" which is not a
valid value.
It should be "landscape" or "portrait" or nothing at all.

On Nov 28, 2006, at 2:28 PM, David B. Reusch wrote:

> I have been experimenting with gsnPanelBottom and have come to the
> conclusion that setting it to even a very small value (e.g., 0.0005)
> results in a larger, apparently minimum amount of padding space being
> added at the bottom of my paneled plots. The postscript files found
> in the linked tar file below demonstrate what I'm seeing. The file
> has an example with gsnPanelBottom unset ( and
> one with it set to 0.0005 ( if I don't set
> gsnPanelBottom to *something*, I get the unwanted behavior of having
> the paneled figures overlay my added text at NDC y coordinate = 0.03.
> I have used a number of values for gsnPanelBottom between 0.005 and
> 0.08 and seen much the same results. I can't rule out that this has
> something to do with my combination of
> gsnPanelXWhiteSpacePercent/gsnPanelYWhiteSpacePercent values and the
> panel dimensions, but I thought it would be worth having someone else
> look at it since these other parameters are pretty much fixed.
> the tar file nclex.tgz is here:
> thanks,
> dave
> --
> 517 Deike Building
> Earth & Environmental Systems Institute
> Penn State University
> University Park, PA 16802
> _______________________________________________
> ncl-talk mailing list

ncl-talk mailing list
Received on Tue Nov 28 2006 - 22:49:16 MST

This archive was generated by hypermail 2.2.0 : Wed Nov 29 2006 - 10:31:37 MST