Re: colorbar for each panel

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 11 Jul 2006 11:02:57 -0600

Hi Chao,

You need to have res1_at_cnLevelSelectionMode = "ManualLevels" set to use
the cnMinLevelValF/cnMaxLevelValF/cnLevelSpacingF resources:

http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnLevelSelectionMode

Good luck,
Adam

Chao Luo wrote:
> Dear Julie,
>
> Thanks much! it works. One more question is that I set up same
> res1_at_cnMinLevelValF, res1_at_cnMaxLevelValF, res_at_cnLevelSpacingF, but color
> bar show different scales, some one show 0.2-0.4, some bar shows
> 0.1-0.3. How to force all color bar (last 4 panels) show same scale?
> Please see attached plot.
>
> Thanks,
>
> Chao
>
>
> On Mon, 2006-07-10 at 20:09 -0600, Julie Arblaster wrote:
>
>>Dear Chao,
>>
>>To draw a color bar for each plot, set
>>res1_at_lbLabelBarOn=True.
>>
>>To draw one color bar for a 6-panel plot you need to set
>>resP_at_gsnPanelLabelBar=True.
>>
>>gsn_panel calls frame so you do not need the line
>>frame(wks_id). Removing that line should stop you getting
>>the 2nd blank page in your postscript file.
>>
>>Cheers,
>>Julie
>>
>>On Mon, 10 Jul 2006, Chao Luo wrote:
>>
>>
>>>Hi All,
>>>
>>>I am trying to make 6 panel on one page (landscape), each panel has own
>>>scale and color bar. I set "resP_at_lbLabelBarOn = True" and set
>>>res1_at_cnMinLevelValF and res1_at_cnMaxLevelValF for each panel. But the
>>>color bar didn't show up, and always has two page (second page is blank)
>>>of the plot.
>>>very appreciate for any help!
>>>
>>>Chao
>>>
>>>below is the script I used.
>>>
>>>
>>>
>>>; $Id$
>>>
>>>; Purpose: Plot AMSR-E soil moisture data
>>>
>>>begin
>>>
>>>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/shea_util.ncl"
>>>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>
>>> diri = "/data3/chaoluo/camdst/cam3019aersombf/"
>>> fl_mdl_3 = addfile(diri+"cam3019aersombf_annual.nc","r")
>>> fl_mdl_4 = addfile(diri+"dstmpc01.nc","r")
>>> fl_mdl_5 = addfile(diri+"dstmpc02.nc","r")
>>> fl_mdl_6 = addfile(diri+"dstmpc03.nc","r")
>>> fl_mdl_7 = addfile(diri+"dstmpc04.nc","r")
>>> fl_mdl_8 = addfile(diri+"DSTMPFRC1.nc","r")
>>> fl_mdl_9 = addfile(diri+"DSTMPFRC2.nc","r")
>>> fl_mdl_10 = addfile(diri+"DSTMPFRC3.nc","r")
>>> fl_mdl_11 = addfile(diri+"DSTMPFRC4.nc","r")
>>>
>>>if(.not.isvar("dev")) then
>>> dev="ps"; "x11", "ps", or "ncgm"
>>>end if
>>>if(dev.eq."x11") then
>>> wks_id=create "wks" xWorkstationClass noparent
>>> end create
>>>end if ; endif "x11"
>>>if(dev.eq."ps") then
>>> wks_id=create "wks" psWorkstationClass defaultapp
>>> "wkPSFileName":
>>>"/data3/chaoluo/camdst/cam3019aersombf/dust_6p.ps"
>>> end create
>>>end if ; endif "ps"
>>>
>>>dstod = fl_mdl_3->DUSTOD_v(0,:,:)
>>>dstmpc1 = fl_mdl_4->DSTMPC01(0,:,:)
>>>dstmpc2 = fl_mdl_5->DSTMPC02(0,:,:)
>>>dstmpc3 = fl_mdl_6->DSTMPC03(0,:,:)
>>>dstmpc4 = fl_mdl_7->DSTMPC04(0,:,:)
>>>dstodt =dstod
>>>dstodt = dstodt*1.0
>>>dstmpct=dstmpc1
>>>dstmpct=dstmpc1+dstmpc2+dstmpc3+dstmpc4
>>>
>>>frc1 = fl_mdl_8->DSTMPFRC1(0,:,:)
>>>frc2 = fl_mdl_9->DSTMPFRC2(0,:,:)
>>>frc3 = fl_mdl_10->DSTMPFRC3(0,:,:)
>>>frc4 = fl_mdl_11->DSTMPFRC4(0,:,:)
>>>
>>>printVarSummary(dstmpc1)
>>>printVarSummary(dstmpct)
>>>
>>>gsn_define_colormap(wks_id,"BlAqGrYeOrRe") ; choose colormap
>>>plot = new(6,graphic)
>>>
>>>res1 = True
>>> res1_at_gsnDraw = False
>>> res1_at_gsnFrame = False
>>> res1_at_lbLabelBarOn = False
>>>
>>> res1_at_mpPerimOn = False
>>> res1_at_mpGridLatSpacingF = 30.
>>> res1_at_mpGridLonSpacingF = 30.
>>> res1_at_mpFillOn = False
>>>
>>> res1_at_cnLineLabelsOn = False
>>> res1_at_cnFillOn = True
>>> res1_at_cnLinesOn = False
>>> res1_at_mpPerimOn = True
>>> res1_at_gsnPaperMargin = 0.25
>>>
>>>res1_at_gsnSpreadColors = True
>>> res1_at_cnMinLevelValF = 0.0
>>> res1_at_cnMaxLevelValF = 2.0
>>> res1_at_cnLevelSpacingF = 0.2
>>> res1_at_gsnMaximize = True
>>> res1_at_lbLabelBarOn = False
>>> res1_at_gsnLeftString = ""
>>> res1_at_gsnRightString = ""
>>> res1_at_gsnCenterString = "DUSTOD_v"
>>> plot(0) = gsn_csm_contour_map_ce(wks_id,dstodt,res1)
>>>
>>> res1_at_cnMinLevelValF = 0.0
>>> res1_at_cnMaxLevelValF = 500.0
>>> res1_at_cnLevelSpacingF = 50.
>>> res1_at_gsnCenterString = "DSTMPC (mg/m2)"
>>> plot(1) = gsn_csm_contour_map_ce(wks_id,dstmpct,res1)
>>>
>>> res1_at_cnMinLevelValF = 0.0
>>> res1_at_cnMaxLevelValF = 1.0
>>> res1_at_cnLevelSpacingF = 0.1
>>> res1_at_gsnCenterString = "DSTMPC01/DSTMPC"
>>> plot(2) = gsn_csm_contour_map_ce(wks_id,frc1,res1)
>>> res1_at_gsnCenterString = "DSTMPC02/DSTMPC"
>>> plot(3) = gsn_csm_contour_map_ce(wks_id,frc2,res1)
>>>
>>> res1_at_gsnCenterString = "DSTMPC03/DSTMPC"
>>> plot(4) = gsn_csm_contour_map_ce(wks_id,frc3,res1)
>>> res1_at_gsnCenterString = "DSTMPC04/DSTMPC"
>>> plot(5) = gsn_csm_contour_map_ce(wks_id,frc4,res1)
>>>
>>>resP = True
>>>; resP_at_gsnPanelYWhiteSpacePercent = 5
>>>; resP_at_gsnPanelXWhiteSpacePercent = 5
>>>; resP_at_cnFillColors = (/ 5,20,35,50,0,0,65,75,85,96/)
>>> resP_at_gsnMaximize = True
>>>; resP_at_gsnPanelLabelBar = True
>>> resP_at_lbLabelBarOn = True
>>> resP_at_gsnPaperOrientation = "landscape"
>>>; resP_at_lbOrientation = "vertical" ; vertical label bar
>>> resP_at_lbOrientation = "horizontal"
>>> resP_at_lbLabelAutoStride = True ; nice label bar labels
>>> resP_at_lbTitleOn = True
>>>; resP_at_lbTitleString = "Sig lvl"
>>> resP_at_lbTitlePosition = "Bottom"
>>> resP_at_lbTitleFontHeightF = .012
>>> resP_at_lbTitleDirection = "Across"
>>>; resP_at_txString = title
>>> gsn_panel(wks_id,plot,(/3,2/),resP)
>>> frame(wks_id)
>>>end
>>>
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>ncl-talk mailing list
>>>ncl-talk_at_ucar.edu
>>>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>ncl-talk mailing list
>>ncl-talk_at_ucar.edu
>>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 11 2006 - 11:02:57 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 11 2006 - 14:05:41 MDT