Re: Problem with cnLabelBarEndStyle

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 20 2011 - 09:12:22 MDT

Arne,

I think I've found a work-around, but wanted you to try it before I see how to fix this.

The issue seems to be with the font size of the labelbar labels. If you make them smaller, then those labels that are dropping off will reappear.

Can you try adding this and let me know if it works:

resources.lbLabelFontHeightF = 0.02

--Mary

On May 20, 2011, at 8:19 AM, Arne Kriegsmann wrote:

> Hi Mary,
>
>
> I use PyNGL 1.3.1.
>
> Sorry, I forgot to mention that the skript in my original posting has to be executed three times, one time for each option.
>
> But, here is the corrected version of the skript that produces all three ps-files.
>
>
> Thanks
>
> Arne
>
>
> import sys,os
>
> import Nio
>
> import Ngl
>
>
> cdf_file = Nio.open_file(os.path.join(Ngl.pynglpath("data"),"cdf","contour.cdf"),"r")
>
> Z = cdf_file.variables["Z"] # geopotential height
>
>
> #Figure 1 - IncludeMinMaxLabels
>
> wkres = Ngl.Resources()
>
> wkres.wkColorMap = "default"
>
> wks_type = "ps"
>
> wks = Ngl.open_wks(wks_type,"IncludeMinMaxLabels",wkres)
>
> resources = Ngl.Resources()
>
> resources.cnFillOn = True # Turn on contour line fill.
>
> resources.cnMonoFillPattern = True # Turn solid fill back on.
>
> resources.cnLineLabelsOn = False # Turn off line labels.
>
> resources.cnLabelBarEndStyle = "IncludeMinMaxLabels"
>
> resources.tiMainString = "IncludeMinMaxLabels"
>
> plot = Ngl.contour(wks,Z[0,0,:,:],resources) # Draw a contour plot.
>
>
> #Figure 2 - IncludeOuterBoxes
>
> wkres = Ngl.Resources()
>
> wkres.wkColorMap = "default"
>
> wks_type = "ps"
>
> wks = Ngl.open_wks(wks_type,"IncludeOuterBoxes",wkres)
>
> resources = Ngl.Resources()
>
> resources.cnFillOn = True # Turn on contour line fill.
>
> resources.cnMonoFillPattern = True # Turn solid fill back on.
>
> resources.cnLineLabelsOn = False # Turn off line labels.
>
> resources.cnLabelBarEndStyle = "IncludeOuterBoxes"
>
> resources.tiMainString = "IncludeOuterBoxes"
>
> plot = Ngl.contour(wks,Z[0,0,:,:],resources) # Draw a contour plot.
>
>
> #Figure 3 - ExcludeOuterBoxes
>
> wkres = Ngl.Resources()
>
> wkres.wkColorMap = "default"
>
> wks_type = "ps"
>
> wks = Ngl.open_wks(wks_type,"ExcludeOuterBoxes",wkres)
>
> resources = Ngl.Resources()
>
> resources.cnFillOn = True # Turn on contour line fill.
>
> resources.cnMonoFillPattern = True # Turn solid fill back on.
>
> resources.cnLineLabelsOn = False # Turn off line labels.
>
> resources.cnLabelBarEndStyle = "ExcludeOuterBoxes"
>
> resources.tiMainString = "ExcludeOuterBoxes"
>
> plot = Ngl.contour(wks,Z[0,0,:,:],resources) # Draw a contour plot.
>
>
> Ngl.end()
>
>
>
> Am Friday 20 May 2011 15:51:17 schrieb Mary Haley:
>
> > Hi Arne,
>
> >
>
> > What version of PyNGL are you running? I just tried your script and got the
>
> > attached PS file. This was with PyNGL 1.3.1.
>
>
>
>
> --
>
> Arne Kriegsmann
>
> Wissenschaftlicher Mitarbeiter
>
> Abteilung Klimasystem
>
> Climate Service Center
>
> Bundesstr. 45a
>
> D-20146 Hamburg
>
> Tel. 040 41173 320
>
> Fax 040 226 338 163
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 20 09:12:31 2011

This archive was generated by hypermail 2.1.8 : Mon Jun 20 2011 - 12:30:20 MDT