Re: problem with panel plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 16 2014 - 15:00:21 MST

Hi Mamadou,
You should always set res@gsnDraw = False (same for gsnFrame) when
creating a panel plot so the individual plot calls do not result in
plots getting drawn or the frame getting advanced prior to the gsn_panel
call. It is also good coding practice to create a separate resource
list for your gsn_panel call.

Thus, change this:
res@gsnDraw = True
to this
res@gsnDraw = False

and change this:
res@gsnPanelXWhiteSpacePercent = 5
res@gsnPanelYWhiteSpacePercent = 5
gsn_panel(wks,plot,(/5,2/),res)
frame(wks)

to this:

panres = True
panres@gsnPanelXWhiteSpacePercent = 5
panres@gsnPanelYWhiteSpacePercent = 5
gsn_panel(wks,plot,(/5,2/),panres)

If that does not fix the issue please respond to ncl-talk and let
everyone know.
Adam

On 01/16/2014 02:48 PM, mamadoulamine.mbaye@ucad.edu.sn wrote:
> Dear NCL users,
> I want to create a panel with 10 plots (/5,2/), But I have a problem
> to get what I want. I join the panel I got!
> this is my script:
>
> plot = new(10,graphic)
> date=(/1,2,3,4,5,6,7,8,9,10,11,12/)
> wks = gsn_open_wks("x11","toto")
>
> res = True
> res@gsnMaximize = True
> res@gsnDraw = True
> res@gsnFrame = False
> res@gsnXYBarChart = True
> res@gsnXYBarChartBarWidth = 0.60
>
> res@tiMainFontHeightF=0.020
> res@tiXAxisString = "Months"
> res@tiYAxisString = "Temperature biases(deg C)"
> res@tiXAxisFontHeightF=0.020
> res@tiYAxisFontHeightF=0.020
>
> res@trXMinF = 0
> res@trXMaxF = 13
> res@trYMinF = -5
> res@trYMaxF = 2
>
> res@tmXBMode = "Explicit"
> res@tmXBValues = date
> res@tmXBLabels
> =(/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)
> res@tmXBLabelFontHeightF = 0.015
> res@tmLabelAutoStride = True
>
> res@gsnYRefLine = 0.
> res@gsnXYBarChart = True
> res@gsnAboveYRefLineColor = "red"
> res@gsnBelowYRefLineColor = "blue"
>
>
> res@tiMainString = "CCCma-CanESM2_SMHI-RCA4"
> plot(1) = gsn_csm_xy (wks,date,tas1,res)
>
> res@tiMainString = "CNRM-CERFACS-CNRM-CM5_SMHI-RCA4"
> plot(2) = gsn_csm_xy (wks,date,tas2,res)
>
> res@tiMainString = "ICHEC-EC-EARTH_DMI-HIRHAM5"
> plot(3) = gsn_csm_xy (wks,date,tas3,res)
>
> res@tiMainString = "ICHEC-EC-EARTH_SMHI-RCA4"
> plot(4) = gsn_csm_xy (wks,date,tas4,res)
>
> res@tiMainString = "MIROC-MIROC5_SMHI-RCA4"
> plot(5) = gsn_csm_xy (wks,date,tas5,res)
>
> res@tiMainString = "MOHC-HadGEM2-ES_SMHI-RCA4"
> plot(6) = gsn_csm_xy (wks,date,tas6,res)
>
> res@tiMainString = "MPI-ESM-LR_MPI-RCSM-REMO"
> plot(7) = gsn_csm_xy (wks,date,tas7,res)
>
> res@tiMainString = "MPI-M-MPI-ESM-LR_SMHI-RCA4"
> plot(8) = gsn_csm_xy (wks,date,tas8,res)
>
> res@tiMainString ="NCC-NorESM1-M_SMHI-RCA4"
> plot(9) = gsn_csm_xy (wks,date,tas9,res)
>
> res@tiMainString ="NOAA-GFDL-ESM2M_SMHI-RCA4"
> plot(10) = gsn_csm_xy (wks,date,tas10,res)
>
> res@gsnPanelXWhiteSpacePercent = 5
> res@gsnPanelYWhiteSpacePercent = 5
>
> gsn_panel(wks,plot,(/5,2/),res)
> frame(wks)
>
> Regards
> Mamadou
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/staff/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 16 15:00:32 2014

This archive was generated by hypermail 2.1.8 : Sun Jan 19 2014 - 21:56:35 MST