Hello,
I was wondering if it is possible to control the
following on the LabelBar of a contour plot:
* The format of the numbers, e.g. can I say specify
F4.2 for how the numbers are formatted ?
* The labels which are shown, e.g. only draw boxes/lines
and labels for numbers which are spaced by a given
increment (say every 0.5 units) or which are specified
by me (for example can I tell the NCL to only show/draw
the labels for 2.2,2.6,3.0 on the labelbar when I am
using the contour levels between those numbers to color
the plot ?).
THE CATCH is that I wish to use ALL of the colors in the
colormap for the plot, so that the data is shown with
smoothly varying colors.
Excerpts from my code follow (which does not give desired result):
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ;..
flt2string()
begin
...
...
gsn_define_colormap(wks,"rainbow")
the_color_map = gsn_retrieve_colormap(wks)
temp = dimsizes(the_color_map)
num_colors = temp(0)
indexC1 = NhlNewColor(wks,0.70,0.70,0.70)
indexC2 = NhlNewColor(wks,1.00,0.60,0.90) ;.. My polygon color
res0 = res
res0_at_gsnSpreadColors = True ;.. Use full range of colormap
;.. Color index 0 is background (default=white)
;.. Color index 1 is foreground (default=black)
res0_at_gsnSpreadColorStart = 2 ;.. Start at color 3 = color index 2
res0_at_gsnSpreadColorEnd = -3 ;.. If added TWO new color.
res0_at_mpLandFillColor = indexC1
res0_at_cnFillOn = True ; turn on color
res0_at_cnLinesOn = False ; no contour lines
res0_at_cnFillDrawOrder = "PreDraw"
res0_at_cnFillMode = "RasterFill" ; turn on raster mode
res0_at_cnLevelSelectionMode = "EqualSpacedLevels"
res0_at_cnMaxLevelCount = num_colors
res0_at_cnMinLevelValF = -1.4 ; set min contour level
res0_at_cnMaxLevelValF = 1.5 ; set max contour level
res0_at_cnLabelBarEndLabelsOn = True ; turn on end labels
;.......................................................................
........
res0_at_lbOrientation = "Vertical" ; vertical label bar
res0_at_lbLabelAutoStride = True
res0_at_lbAutoManage = False
...
...
plot1 = gsn_csm_contour_map_ce(wks, rdata, res0) ; contour the
variable
...
...
end
=====
Bruce Lunde
Bruce.Lunde_at_navy.mil
228-688-5843
Code NP1
Naval Oceanographic Office
Stennis Space Center, MS
=====
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 29 2007 - 14:10:18 MDT
This archive was generated by hypermail 2.2.0 : Sun Apr 01 2007 - 11:52:47 MDT