Problem with cnLabelBarEndStyle

From: Arne Kriegsmann <arne.kriegsmann_at_nyahnyahspammersnyahnyah>
Date: Fri May 20 2011 - 04:58:13 MDT

I am trying to use different styles of the colorbar. With pyngl, the value of
cnLabelBarEndStyle defines the style of the end of the colorbar.
Only one of the three possible values works ("IncludeOuterBoxes"). The other
two values ("IncludeMinMaxLabels", "ExcludeOuterBoxes") generate not all of
labels for the colorbar. The second largest as well as the second smallest
value is missing.

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

wkres = Ngl.Resources()
wkres.wkColorMap = "default"
wks_type = "ps"
wks = Ngl.open_wks(wks_type,"ngl02p",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.cnLabelBarEndStyle = "IncludeOuterBoxes"
#resources.cnLabelBarEndStyle = "ExcludeOuterBoxes"

plot = Ngl.contour(wks,Z[0,0,:,:],resources) # Draw a contour plot.

Ngl.end()

Thanks
Arne

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

includeouterboxes.jpg excludeouterboxes.jpg includeminmaxlabels.jpg
Received on Fri May 20 04:58:37 2011

This archive was generated by hypermail 2.1.8 : Wed May 25 2011 - 09:35:33 MDT