reversing a color palette

From: <Solange.Fermepin_at_nyahnyahspammersnyahnyah>
Date: Sat Oct 26 2013 - 08:43:28 MDT

Hello everybody,

I'm trying to make a panel plot with two different color tables, one of
which I actually need reversed.

I would like to use the cnFillPalette resource, since it is easier to
manage individually for each figure of the panel (below, the relevant part
of my code). However, I did not find a way to reverse the palette...

All I found were gsn resources to reverse a colormap of a wks, and if I
use them (I tried just in case) it gives me an error
(warning:ContourPlotSetValues: color index (209) exceeds size of palette,
defaulting to foreground color for entry (9)).
I can not merge the color maps since I think that wether I reverse both
palettes or none.

I guess I can try to make my own palette by retrieving the colors of ecah
palette, and manually reverse the ones I need. I was wondering whether
there is an easy solution for my problem that I'm missing.

Thanks a lot!

 plot1 = new(6,graphic)
  res@cnFillPalette = "precip4_11lev"
  res@cnSpanFillPalette = True
  res@cnLevelSelectionMode = "ManualLevels" ; set manual contour
  res@cnMinLevelValF = -80. ; set min contour level
  res@cnMaxLevelValF = 0.
  res@cnLevelSpacingF = 8.
 plot1(0) = gsn_csm_contour_map_ce(wks,swtoa_obs,res)
 plot1(1) = gsn_csm_contour_map_ce(wks,swsfc_obs,res)
  res@cnFillPalette = "spread_15lev"
  res@cnLevelSelectionMode = "ExplicitLevels"
  res@cnLevels = (/ 0.,5.,10.,15.,20.,25.,30.,40.,50.,60.,70./)
  res@lbLabelStride = 1.
 plot1(2) = gsn_csm_contour_map_ce(wks,lwtoa_obs,res)

Solange Fermepin, PhD student
Laboratoire de Météorologie Dynamique - CNRS/IPSL
Tour 45-55, 3ème étage
4 place Jussieu
75252 Paris cedex 05
Tel: +33 (0) 1 44 27 52 55
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Sat Oct 26 08:44:07 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 01 2013 - 08:58:14 MDT