Re: automatic scale of colors

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 11 Sep 2008 07:55:26 -0600

Ola Edson,

I apologize for not understanding.

When you write, "inverting the order of that scale of colors",
do you mean reversing the colormap order? If so, the following
procedure may be used

                 gsn_reverse_colormap(wks)

There are many color examples at:
         http://www.ncl.ucar.edu/Applications/color.shtml

Attached is a slightly revised script.

Good Luck
Edson L. Nunes - UFV wrote:
> To the users of the list,
>
> Does it follow a script and a data file NetCDF enclosed to generate a
> regional map with the automatic scale of colors, would I like to know
> if has as inverting the order of that scale of colors?
> If somebody can help myself, I will be very grateful.
>
> Respectfully,
>
> Edson.
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-install mailing list
> ncl-install_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================

;*************************************************
; mapa_temp.ncl
;************************************************
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;************************************************
begin
;************************************************
; open file and read in data
;************************************************

 ;dir = "/home/elnunes/rate1.0-2d/NCEP/TEMP/"
  dir = "./"
  in = addfile(dir + "TEMP_0.40g.200400112.SA.nc","r")
  temp = in->temp(0,:,:) ; type integer
  printVarSummary( temp )

  tempera = temp*0.01+512.81
  copy_VarCoords(temp, tempera)
  tempera_at_long_name = "Air Temperature at surface"
  printVarSummary(tempera)

;************************************************
; create plot
;************************************************

  wks = gsn_open_wks("x11", "Temperature") ;"X11" para visualizar / "ps"/"pdf" para aquivo
  gsn_define_colormap(wks,"gui_default")
  gsn_reverse_colormap(wks) ; reverse the color order
                       
;********************visual effect****************************

  res = True
  res_at_cnFillOn = True ; color fill
  res_at_cnLinesOn = False ; no contour lines
  res_at_cnLineLabelsOn = False ; no contour labels
  res_at_gsnSpreadColors = True ; use total colormap
 ;res_at_gsnSpreadColorStart = -1
 ;res_at_gsnSpreadColorEnd = 4
  res_at_cnInfoLabelOn = False ; no contour info label

  res_at_tmXBLabelFontHeightF = 0.015
  res_at_tmYLLabelFontHeightF = 0.015
  res_at_lbLabelFontHeightF = 0.012

  res_at_tmYLLabelFont = 25
  res_at_tmXBLabelFont = 25
  res_at_lbLabelFont = 25

  ;res_at_tmXBLabelStride = 2
  ;res_at_tmYLLabelStride = 2
  ;res_at_lbLabelStride = 2
   res_at_lbLabelAutoStride = True
 
  res_at_mpOutlineBoundarySets = "allBoundaries" ;-------------- divisao dos paises

  res_at_mpGridLineDashPattern = 2 ; lat/lon lines as dashed
  res_at_pmTickMarkDisplayMode = "Always" ; turn on tickmarks
  
  res_at_gsnAddCyclic = False ; regional data
  res_at_mpDataBaseVersion = "MediumRes"
  

;*****************defines scale of the legend************************
    
  res_at_cnLevelSelectionMode = "ExplicitLevels" ; "ManualLevels"

  res_at_cnLevels = (/270.,273.,276.,279.,282.,285.,288.,291.,294.,297.,300.,\
                   303./)

;*****************defines scale lat/lon******************************

  res_at_mpMaxLatF = 20
  res_at_mpMinLatF = -60
  res_at_mpMaxLonF = -30
  res_at_mpMinLonF = -100
  res_at_cnFillMode = "RasterFill" ; nao interpolar..

          
; res_at_tiMainString = " "
  tempera_at_units = " "
  res_at_lbTitleString = "Air Temperature (K)"
  res_at_lbTitleFontHeightF = 0.015
  res_at_lbTitlePosition = "Bottom"
 
;******************print the graph*********************************
 
plot = gsn_csm_contour_map(wks,tempera,res)

end

_______________________________________________
ncl-install mailing list
ncl-install_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-install
Received on Thu Sep 11 2008 - 07:55:26 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 01 2008 - 09:49:35 MDT