Re: Layout of label bar in PyNgl

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 15 Feb 2008 15:16:16 -0700 (MST)

Hi Daran,

I've been playing with your script, and I think a quick workaround
is to set panelres_at_gsnPanelBotton to a value like 0.07, which will
give you more space at the bottom for your labelbar and the
vector plot annotation.

The paneling routine should have left room for your title, so I'm
not sure why it didn't. We'll have to look into this.

Also, there's a special resource for setting the font height for
the panel labelbar, and that is:

     nglPanelLabelBarLabelFontHeightF

Again, though, the paneling routine should have also recognized
lbLabelFontHeightF. I'll look into this.

Meanwhile, I got your labelbar to look a little better. I'm not sure
exactly what panel resources you wanted to keep, but I've included
below what I used in your script (I'm a bit anal so I sorted them by
type). I removed some of the ones you had if they were redundant or
non-applicable.

If you still can't get the panels to look quite right, let me know.

     # Set up labelbar resources.
     panelres = ngl.Resources()

     panelres.nglPaperOrientation = 'Portrait'

     panelres.nglPanelTop = 0.95
     panelres.nglPanelBottom = 0.07

     panelres.nglPanelFigureStrings = t_label
     panelres.nglPanelFigureStringsFontHeightF = 0.0125
     panelres.nglPanelFigureStringsJust = 'TopLeft'

     panelres.nglPanelLabelBar = True # Turn on panel labelbar
     panelres.nglPanelLabelBarWidthF = 0.7 # Width of labelbar
     panelres.nglPanelLabelBarHeightF = 0.10 # Height of labelbar
     panelres.nglPanelLabelBarLabelFontHeightF = 0.0125

     panelres.lbRasterFillOn = True
     panelres.lbBoxLineThicknessF = 2.5

     panelres.lbTitleString = 'Reccurence frequency (days)'
     panelres.lbTitleFont = 'helvetica-bold'
     panelres.lbTitleFontHeightF = 0.015
     panelres.lbTitleOffsetF = 0.01

     # Draw 4 rows and 3 columns of plots.
     ngl.panel(wks, plot, [4,3], panelres)

Have a great weekend!

--Mary

On Thu, 14 Feb 2008, Daran L. Rife wrote:

> Hello,
>
> I'm having a dickens of a time getting a label
> bar to lie properly on my plot. Though I have
> studied all the PyNgl examples carefully, and
> searched round the ncl-talk mailing list archive,
> I still fail to find a solution.
>
> I'd appreciate someone pointing out where my
> method errs. My plot consists of:
>
> (1) Creating twelve separate overlay plots,
> (2) Then calling Ngl.panel() to automatically
> arrange the plots on paper.
>
> The script, data, and troubled plot can be
> found at:
>
> ftp://ftp.rap.ucar.edu/incoming/irap/drife
>
> My problem is twofold: (a) the label bar is
> laid atop the bottom row of plots, and (b)
> the label bar font size is too large, even
> though I have set both the lbLabelFontHeightF
> pmLabelBarOrthogonalPosF parameters. Neither
> parameter setting seems to have and effect,
> regardless of the values I use.
>
>
> Thanks in advance for your help.
>
>
> Daran
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 15 2008 - 15:16:16 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 15 2008 - 17:17:57 MST