Re: different color map for different maps

From: Maria Gehne - NOAA Affiliate <maria.gehne_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 05 2014 - 15:50:15 MST

Hi Mamadou,

please look at the NCL examples website:
http://ncl.ucar.edu/Applications/rgbacolor.shtml

Examples #13 and #14 seem to be exactly what you are looking for. You need
NCL version 6.1.0 for these to work.

If you have an older version of NCL you can try:
http://ncl.ucar.edu/Applications/panel.shtml

Example #26 describes how to generate panels with different colormaps.

Hope this helps,
Maria

On Wed, Mar 5, 2014 at 2:05 PM, mamadoulamine.mbaye@ucad.edu.sn <
mamadoulamine.mbaye@ucad.edu.sn> wrote:

> Hi,
>
> I would like to create a different colour map for 4 different panels. In
> this present case I want to have red-white-blue colour table for the delta
> and change (plot2,plot3,and plot4), the white should be around zero (see
> joined figure). I have tried with gsn_define_colormap(wks,"BlWhRe") after
> the first panel, for the remaining panel but it doesn't not work. this is
> my script:
>
>
>
> ;=====================================================
>
> wks = gsn_open_wks("x11", "toto")
> gsn_reverse_colormap(wks)
>
>
> plot1 = new(4,graphic)
> plot2 = new(2,graphic)
> plot3=new(2,graphic)
> plot4=new(1,graphic)
>
> res = True
> res@gsnMaximize = True
> res@gsnDraw = False ; don't draw
> res@gsnFrame = False ; don't advance frame
> res@cnInfoLabelOn = False ; turn off cn info label
> res@cnFillOn = True ; turn on color
> res@cnLinesOn = False ; don't draw contour lines
> res@cnLineLabelsOn = False ; don't show the values of
> contour
> res@gsnAddCyclic = False
> res@gsnSpreadColors = True ; spread out color table
> res@cnFillMode = "RasterFill" ; turn raster on
> res@lbLabelBarOn = False ; turn off individual cb's
> res@mpLimitMode="LatLon"
> res@mpMinLonF=-18
> res@mpMaxLonF=-6
> res@mpMinLatF=9
> res@mpMaxLatF=19
> res@tmXBTickSpacingF= 3
> res@tmYLTickSpacingF = 3
> ;res@tmXBLabelStride = 2
> res@gsnRightString=""
>
> res@tmXBLabelFontHeightF =0.025
> res@tmYLLabelFontHeightF =0.025
>
>
> res@cnLevelSelectionMode = "ManualLevels"
> res@cnMinLevelValF = 10
> res@cnMaxLevelValF = 80
> res@cnLevelSpacingF = 10
>
> ;=================== For boundries of countries
> res@mpDataSetName = "Earth..3"
> res@mpDataBaseVersion = "Ncarg4_1"
> res@mpOutlineBoundarySets = "AllBoundaries"
>
> res@txFontHeightF = 0.03
> res@gsnLeftString = "UC_HISTO"
> plot1(0) = gsn_csm_contour_map_ce(wks,pr1,res)
>
> res@gsnLeftString = "UC_RCP45"
> plot1(2) = gsn_csm_contour_map_ce(wks,pr2,res)
>
> res@gsnLeftString = "BC_HISTO"
> plot1(1) = gsn_csm_contour_map_ce(wks,pr4,res)
>
> res@gsnLeftString = "BC_RCP45"
> plot1(3) = gsn_csm_contour_map_ce(wks,pr5,res)
>
>
> ;----------Create Panel1-----------------------------------------------
> resP = True
> resP@gsnMaximize = True
> resP@lbAutoManage = False
> resP@gsnFrame = False
> resP@gsnPanelLabelBar = True
> resP@lbLabelFontHeightF = 0.008
> resP@gsnPanelLeft =0.02
> resP@gsnPanelRight =0.6
> resP@gsnPanelTop = 0.98
> resP@gsnPanelBottom =0.43
> resP@gsnPanelYWhiteSpacePercent = 5
> resP@gsnPanelXWhiteSpacePercent = 5
> ;------------------------------Create Panel2-= for Changes========
> res@cnLevelSelectionMode = "ManualLevels"
> res@cnMinLevelValF = -30
> res@cnMaxLevelValF = 10
> res@cnLevelSpacingF = 10
>
>
>
> gsn_define_colormap(wks,"BlWhRe")
> res@gsnLeftString = "Change_UC_RCP45"
> plot2(0) = gsn_csm_contour_map_ce(wks,pr7,res)
>
> res@gsnLeftString = "Change_BC_RCP45"
> plot2(1) = gsn_csm_contour_map_ce(wks,pr8,res)
>
> ;==========================Panel for changes =============
> resP2 =True
> resP2@gsnMaximize =True
> resP2@lbAutoManage =False
> resP2@gsnFrame =False
> resP2@gsnPanelTop =0.49
> resP2@gsnPanelBottom =0.047
> resP2@gsnPanelLeft =0.02
> resP2@gsnPanelRight =0.58
> resP2@gsnPanelLabelBar =True
> resP2@txFontHeightF =0.012
> resP2@lbLabelFontHeightF =0.0075
> resP2@gsnPanelYWhiteSpacePercent = 5
> resP2@gsnPanelXWhiteSpacePercent = 5
> ;-------------------------------------------------DELTA_1 --------
> res@cnLevelSelectionMode = "ManualLevels"
> res@cnMinLevelValF = -40
> res@cnMaxLevelValF = 0
> res@cnLevelSpacingF = 10
>
> res@gsnLeftString = "Delta_histo"
> plot3(0) = gsn_csm_contour_map_ce(wks,d10,res)
>
> res@gsnLeftString = "Delta_RCP45"
> plot3(1) = gsn_csm_contour_map_ce(wks,d20,res)
>
> ;==========================Panel delta_1 ====================
> resP3 =True
> resP3@gsnMaximize =True
> resP3@lbAutoManage =False
> resP3@gsnFrame =False
> resP3@gsnPanelLeft =0.59
> resP3@gsnPanelRight =0.87
> resP3@gsnPaneltop =0.94
> resP3@gsnPanelBottom =0.41
> resP3@gsnPanelLabelBar =True
> resP3@txFontHeightF =0.01
> resP3@lbLabelFontHeightF =0.007
> resP3@gsnPanelYWhiteSpacePercent = 5
> resP3@gsnPanelXWhiteSpacePercent = 5
> ;-----------------------------------------DELTA_2-----------
> res@cnLevelSelectionMode = "ManualLevels"
> res@cnMinLevelValF = -10
> res@cnMaxLevelValF = 20
> res@cnLevelSpacingF = 10
>
> res@gsnLeftString = "Delta_Change_RCP45"
> plot4(0) = gsn_csm_contour_map_ce(wks,d40,res)
>
> ;==========================Panel delta_2 =============
> resP4 =True
> resP4@gsnMaximize =True
> resP4@lbAutoManage =False
> resP4@gsnFrame =False
> resP4@gsnPanelLeft =0.59
> resP4@gsnPanelRight =0.87
> resP4@gsnPanelLabelBar =True
> resP4@txFontHeightF =0.012
> resP4@lbLabelFontHeightF =0.0075
> resP4@gsnPanelLeft =0.58
> resP4@gsnPanelRight =0.86
> resP4@gsnPanelTop =0.49
> resP4@gsnPanelBottom =0.047
> resP4@gsnPanelYWhiteSpacePercent = 5
> resP4@gsnPanelXWhiteSpacePercent = 5
>
> ;===============DRAW THE PANELS ===============
>
>
> gsn_panel(wks,plot1,(/2,2/),resP)
> gsn_panel(wks,plot2,(/1,2/),resP2)
> gsn_panel(wks,plot3,(/2,1/),resP3)
> gsn_panel(wks,plot4,(/1,1/),resP4)
>
> frame(wks)
> end
>
>
> Best regards
>
> Mamadou
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 5 15:50:48 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT