<div dir="ltr">Hi Tabish,<div>There are two ways to go about this that I have used. </div><div>1 - Draw each row separately with 3 calls to gsn_panel, and create the labelbar through panel resources.</div><div>2 - Draw all 12 plots as you are doing, but use gsn_labelbar_ndc to draw the labelbars separately.</div><div><br></div><div>I would highly recommend going with method #1. </div><div>An example of doing this:</div><div><br></div><div>panres = True</div><div>panres@gsnDraw = False</div><div>panres@gsnFrame = False</div><div>panres@gsnMaximize = False ; this has to be False for this method to work</div><div>panres@gsnPanelLabelBar = True</div><div>panres@lbOrientation = "vertical"</div><div>... (set other labelbar resources here in the panel resource list)</div><div>panres@gsnPanelTop = .99</div><div>panres@gsnPanelBottom = .66</div><div>gsn_panel(wks,(/plot1,plot2,plot3,plot4/),(/1,4/),panres)</div><div><div>panres@gsnPanelTop = .66</div><div>panres@gsnPanelBottom = .33</div><div>gsn_panel(wks,(/plot5,plot6,plot7,plot8/),(/1,4/),panres)</div></div><div><div>panres@gsnPanelTop = .33</div><div>panres@gsnPanelBottom = .0</div><div>gsn_panel(wks,(/plot9,plot10,plot11,plot12/),(/1,4/),panres)</div></div><div>maximize_output(wks,False) ; alternatively if you are happy with the default size of the output, do not call maximize_output, set panres@gsnDraw = True, and call frame(wks) on this line</div><div><br></div><div>You might have to go through some trial and error to get the output to what you would like, but the above coding is a good place to start. </div><div>Good luck,</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 19, 2021 at 12:27 PM Tabish Ansari via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">Hi</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">I'm trying to create a 3x4 panelplot. Each plot is a contour map generated from WRF model data. Since each row represents a similar quantity, I'm using a common labelbar for each row, which means I have a total of 3 label bars for this panelplot which are made visible for the 4th, 8th and 12th plots and turned off for all other plots. However, since the rightmost plots include the labelbars, NCL detects their overall size differently which leads to different sizing of the maps in the panel.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">Please see the attached plot.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">Here's the snippet of the graphics part of the code:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><font color="#0b5394"><br></font></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><font color="#0b5394">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PLOTTING OPTIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br> type = "pdf"<br> wks = gsn_open_wks(type,"NOCOVOC_D02_sectoralemissions-panel") ; Create a plot workstation<br> gsn_define_colormap(wks,"BlAqGrYeOrReVi200")<br> ;gsn_define_colormap(wks,"WhiteYellowOrangeRed")<br> ;gsn_define_colormap(wks,"hotres")<br> ;gsn_define_colormap(wks,"MPL_Reds")<br>; Set some basic resources<br> res = True<br><br> pltres = True<br> mpres = True<br> res@cnFillOn = True ; Create a color fill plot<br> pltres@PanelPlot = True<br> res@NoHeaderFooter = True ; Switch headers and footers off<br> mpres@mpOutlineOn = True ; Turn on map outlines<br> mpres@mpFillOn = False ; Turn off map fill<br><br> res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels<br><br> COlevels = (/10,25,50,75,100,200,400,600,800,1000,1500,2000,3000,4000,5000/) ; set levels for CO<br> NOlevels = (/5,10,15,20,25,30,40,50,75,100,125,150,175,200,250/) ; set levels for NO<br> VOClevels = (/5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80/) ; set levels for NMVOCs<br> SO2levels = (/5,10,15,20,25,50,75,100,150,200,250,300/) ; set levels for SO2<br> NH3levels = (/5,10,15,20,25,30,35,40,45,50,60,70,80,90,100/) ; set levels for NH3<br> PMlevels = (/10,25,50,100,150,200,250,500,1000,1500,2000,2500,3000/) ; set levels for Total Aerosol<br><br><br> res@lbLabelBarOn = False ; turn off labelbar, but still customize<br> res@lbOrientation = "Vertical" ; it so we can recreate it later<br> res@lbTitleAngleF = 90. ; title angle<br> res@lbTitlePosition = "Right" ; title location<br> res@lbTitleDirection = "Across" ; letter angle<br> res@lbLabelFontHeightF = 0.025<br> res@pmLabelBarOrthogonalPosF = -1.05<br> res@pmLabelBarParallelPosF = 1.2<br><br>;---Resources for 1st row of plots<br> res1 = res<br> res1@cnLevels = NOlevels<br> res1@lbTitleString = "NO"<br><br>;---Resources for 2nd row of plots<br> res2 = res<br> res2@cnLevels = COlevels<br> res2@lbTitleString = "CO"<br></font></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><font color="#0b5394"><br>;---Resources for 3rd row of plots<br> res3 = res<br> res3@cnLevels = VOClevels<br> res3@lbTitleString = "NMVOC"<br><br>;---Contour resources for each set of contour plots<br> res11 = res1<br> res12 = res1<br> res13 = res1<br> res14 = res1<br><br> res21 = res2<br> res22 = res2<br> res23 = res2<br> res24 = res2<br><br> res31 = res3<br> res32 = res3<br> res33 = res3<br> res34 = res3<br><br>;---Rightmost plots<br> res14@lbLabelBarOn = True<br> res24@lbLabelBarOn = True<br> res34@lbLabelBarOn = True<br><br> contour_NO_ind = wrf_contour(c2,wks,NO_ind,res11)<br> contour_NO_pow = wrf_contour(c2,wks,NO_pow,res12)<br> contour_NO_tran = wrf_contour(c2,wks,NO_tran,res13)<br> contour_NO_res = wrf_contour(c2,wks,NO_res,res14)<br><br><br> contour_CO_ind = wrf_contour(c2,wks,CO_ind,res21)<br> contour_CO_pow = wrf_contour(c2,wks,CO_pow,res22)<br> contour_CO_tran = wrf_contour(c2,wks,CO_tran,res23)<br> contour_CO_res = wrf_contour(c2,wks,CO_res,res24)<br><br><br> contour_VOC_ind = wrf_contour(c2,wks,VOC_ind,res31)<br> contour_VOC_pow = wrf_contour(c2,wks,VOC_pow,res32)<br> contour_VOC_tran = wrf_contour(c2,wks,VOC_tran,res33)<br> contour_VOC_res = wrf_contour(c2,wks,VOC_res,res34)<br> mpres@mpOutlineBoundarySets = "AllBoundaries" ; turn on country boundaries<br> mpres@mpGeophysicalLineColor = "Black" ; color of cont. outlines<br> mpres@mpNationalLineColor = "Black" ; color of cont. outlines<br> mpres@mpProvincialLineColor = "Black" ; color of cont. outlines<br> mpres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines<br> mpres@mpNationalLineThicknessF = 1.5 ; thickness of outlines<br> mpres@mpProvincialLineThicknessF = 1.5 ; thickness of outlines<br> mpres@mpDataBaseVersion = "MediumRes" ; choose higher resolution<br> mpres@mpDataSetName = "Earth..4" ; choose most recent boundaries<br><br><br>; MAKE PLOTS<br>;pltres@FramePlot = False ; do not frame plot - will do this manually later<br>mpres@tmXTOn = True<br>mpres@tmYROn = True<br> mpres@tmXBMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> mpres@tmXBMinorOutwardLengthF = 0.0 ; draw minor ticks inward<br> mpres@tmYLMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> mpres@tmYLMinorOutwardLengthF = 0.0 ; draw minor ticks inward<br> mpres@tmXTMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> mpres@tmXTMinorOutwardLengthF = 0.0 ; draw minor ticks inward<br> mpres@tmYRMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> mpres@tmYRMinorOutwardLengthF = 0.0 ; draw minor ticks inward<br><br> mpres@tmXBLabelFontHeightF = 0.017<br><br> plot1 = wrf_map_overlays(c2,wks,(/contour_NO_ind/),pltres,mpres)<br> plot2 = wrf_map_overlays(c2,wks,(/contour_NO_pow/),pltres,mpres)<br> plot3 = wrf_map_overlays(c2,wks,(/contour_NO_tran/),pltres,mpres)<br> plot4 = wrf_map_overlays(c2,wks,(/contour_NO_res/),pltres,mpres)<br><br> plot5 = wrf_map_overlays(c2,wks,(/contour_CO_ind/),pltres,mpres)<br> plot6 = wrf_map_overlays(c2,wks,(/contour_CO_pow/),pltres,mpres)<br> plot7 = wrf_map_overlays(c2,wks,(/contour_CO_tran/),pltres,mpres)<br> plot8 = wrf_map_overlays(c2,wks,(/contour_CO_res/),pltres,mpres)<br><br> plot9 = wrf_map_overlays(c2,wks,(/contour_VOC_ind/),pltres,mpres)<br> plot10 = wrf_map_overlays(c2,wks,(/contour_VOC_pow/),pltres,mpres)<br> plot11 = wrf_map_overlays(c2,wks,(/contour_VOC_tran/),pltres,mpres)<br> plot12 = wrf_map_overlays(c2,wks,(/contour_VOC_res/),pltres,mpres)<br></font></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><font color="#0b5394"><br></font></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><font color="#0b5394">;---Retrieve the height used for the first plot and apply to subsequent plots<br> getvalues plot1<br> "vpHeightF" : vph<br> end getvalues<br>setvalues (/plot1,plot2,plot3,plot4,plot5,plot6,plot7,plot8,plot9,plot10,plot11,plot12/)<br> "vpHeightF" : vph<br>end setvalues<br><br> pltres@PanelPlot = True<br><br> ; Panel the WRF plots.<br> pnlres = True<br> pnlres@gsnPanelYWhiteSpacePercent = 5 ; Add white space b/w plots.<br> pnlres@gsnMaximize = True<br>gsn_panel(wks,(/plot1,plot2,plot3,plot4,plot5,plot6,plot7,plot8,plot9,plot10,plot11,plot12/),(/3,4/),pnlres)<br><br> frame(wks)</font><br><br>I'll be extremely grateful if you could please point me to the right direction on how to make all plots of the same height without leaving too much white space in between them.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">Cheers,</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">Tabish</div><div><div dir="ltr"><div dir="ltr"><div><i><span style="color:rgb(68,68,68)"><font face="tahoma, sans-serif">----------------------------------------------------------<br><span style="background-color:rgb(255,255,255)">Dr <a href="https://www.rug.nl/staff/t.u.ansari/" target="_blank">Tabish U Ansari</a></span></font></span></i></div><div><i><span style="color:rgb(68,68,68)"><span style="background-color:rgb(255,255,255)"><font face="tahoma, sans-serif">Assistant Professor - Earth & Energy</font></span></span></i></div><div><i><span style="color:rgb(68,68,68)"><span style="background-color:rgb(255,255,255)"><font face="tahoma, sans-serif">University of Groningen - <span style="font-weight:normal"><a href="https://www.rug.nl/cf/?lang=en" target="_blank">Campus Fryslân</a><br></span></font></span></span></i></div><div><i><span style="color:rgb(68,68,68)"><span style="background-color:rgb(255,255,255)"><span style="font-weight:normal"><font face="tahoma, sans-serif">Leeuwarden, the Netherlands<br></font></span></span></span></i></div><i><span style="color:rgb(68,68,68)"><span style="font-weight:normal"><span style="background-color:rgb(255,255,255)"><font face="tahoma, sans-serif"><a href="https://www.researchgate.net/profile/Tabish_Ansari" target="_blank">ResearchGate</a> | <a href="https://scholar.google.com/citations?user=E94r-mwAAAAJ&hl=en&oi=ao" target="_blank">Google Scholar</a> | <a href="https://twitter.com/tabishbiet" target="_blank">Twitter</a> </font><font face="comic sans ms, sans-serif"><span></span></font></span></span></span></i></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>