<div dir="ltr"><div><div><div>Hi Tabish,<br></div>By default panelling is done using the size of the first plot. Since your first plot has legend on top of the plot (I checked with dummy data) while others do not, and therefore the size of your first plot is larger than the rest. So in your case you can do several things, 2 methods:<br><br></div>1) Move the legend inside the first plot by playing with the resource "res@pmLegendOrthogonalPosF = -0.4", you may need several iterations to adjust. <br><br></div>OR<br><br><div>2) In panel resource list add this "resP@gsnPanelScalePlotIndex      = 1" ; 1 means second plot since it counts from 0.  This would force panel according to  the size of second plot.<br><br><br></div><div>In general, I would also turn off or remove the res@gsnMaximize.<br><br></div><div>Other possible solutions include using viewport  resources.<br></div><div>Cheers,<br></div><div>Rashed<br></div><div><br><br></div><div><div><br><br><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 30, 2018 at 12:25 PM, Tabish Ansari <span dir="ltr"><<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi Rashed<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks very much for your email. I just tried that. Now there's no warning but still there's a lot of white space between the panels even after setting<span style="font-family:verdana,sans-serif"><font size="1"> resP@<i><span style="font-family:verdana,sans-serif"><font size="1">gsnPanelYWhiteSpacePercen<wbr>t</font></span></i> = 0.0<br><br></font></span></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><font size="2"><span style="font-family:verdana,sans-serif"><font face="trebuchet ms,sans-serif">Let me know if there's any solution to this.<br><br><br></font></span></font></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><font size="2"><span style="font-family:verdana,sans-serif"><font face="trebuchet ms,sans-serif">Thanks<br><br></font></span></font></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><span style="font-family:verdana,sans-serif"><font size="1"><font face="trebuchet ms,sans-serif"><font size="2">Tabish</font><br></font></font></span></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_3677755809093186329gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><font size="1"><span style="font-family:tahoma,sans-serif">Tabish U Ansari<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">PhD student, Lancaster Environment Center<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">Lancaster Univeristy<br> <span>Bailrigg</span>, <span>Lancaster</span>, <br><span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br></div></div></div>
<br><div class="gmail_quote">On 30 April 2018 at 06:57, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">sorry forgot to add NCL-talk.<div><div class="m_3677755809093186329h5"><br><div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Rashed Mahmood</b> <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span><br>Date: Sun, Apr 29, 2018 at 10:56 PM<br>Subject: Re: [ncl-talk] Panelplot: reduce white space between panels<br>To: Tabish Ansari <<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>><br><br><br><div dir="ltr"><div><div><div><i><span style="font-family:verdana,sans-serif"><font size="1"></font></span></i><span style="font-family:verdana,sans-serif"><font size="1">Hi Tabish,<br>I think </font></span><i><span style="font-family:verdana,sans-serif"><font size="1">"gsnPanelYWhiteSpacePercent" </font></span></i><span style="font-family:verdana,sans-serif"><font size="1">is a panel resource and should be added in your panel resource list (i.e. resP), try the following:<br>resP@<i><span style="font-family:verdana,sans-serif"><font size="1">gsnPanelYWhiteSpacePercen<wbr>t</font></span></i> = 2  <br><br></font></span></div><span style="font-family:verdana,sans-serif"><font size="1">There are other possible ways of reducing space between the plots, for example, using view point resources:<br><a href="https://www.ncl.ucar.edu/Document/Graphics/Resources/vp.shtml" target="_blank">https://www.ncl.ucar.edu/Docum<wbr>ent/Graphics/Resources/vp.shtm<wbr>l</a><br><br></font></span></div><span style="font-family:verdana,sans-serif"><font size="1">Cheers,<br></font></span></div><span style="font-family:verdana,sans-serif"><font size="1">Rashed<br></font></span><div><div><div><span style="font-family:verdana,sans-serif"><font size="1"><br><br></font></span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_3677755809093186329m_-6491230334574750743h5">On Sun, Apr 29, 2018 at 5:05 PM, Tabish Ansari <span dir="ltr"><<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_3677755809093186329m_-6491230334574750743h5"><div dir="ltr"><div style="font-family:trebuchet ms,sans-serif">Hi<br><br></div><div style="font-family:trebuchet ms,sans-serif">I have 4 time series plots that I want to panel in 4 rows with minimal white space in between them - I do not want to attach the plots to a common axis however.<br><br></div><div style="font-family:trebuchet ms,sans-serif">I'm unable to achieve this using the "gsnPanelYWhiteSpacePercent" resource.<br>On using this resource I get the following warning:<br><b><br>warning:gsnPanelYWhiteSpacePer<wbr>cent is not a valid resource in IAP260m-ts_xy at this time</b><br><br>Here's the relevant part of my script:<br><br><i><span style="font-family:verdana,sans-serif"><font size="1">;---Start the graphics<br>wks = gsn_open_wks("x11","IAP260m-ts<wbr>") ; send graphics to PNG file<br>;---Plotting options for time series plot<br>res             = True<br>res@gsnMaximize = True<br>;res@gsnPaperOrientation = "landscape"<br>;res@vpKeepAspect=False<br>res@tiMainString     = "Pollutants at 260m at IAP site"          ; add title<br>res@vpWidthF    = 2<br>res@vpHeightF   = 0.4<br>res@xyMarkLineMode = "Lines"<br>res@xyMarkers      = (/0,0,0,0/)<br>res@tmXTOn      = False<br>res@tmYLFormat  = "f"      ; remove trailing ".0"<br>res@xyDashPatterns  = (/0,0,0,0/)                   <wbr>      ; Make curves all solid<br>res@xyLineThicknesses = (/  1.0, 1.0, 1.0, 1.0/)          ; make second line thicker<br>res@xyLineColors      = (/"blue","black", "black", "red"/)          ; change line color<br>;-----------------------------<wbr>---------------------<br>; The time_axis_label function adds additional<br>; resources to "res" to produce nicely-formatted<br>; time labels on X axis. This function only works<br>; if you have a time "units" recognized by the<br>; cd_calendar function.<br>;-----------------------------<wbr>---------------------<br>  restick           = True<br>; restick@ttmFormat = "%D_%H"<br>  restick@ttmFormat = "%D"<br>;   restick@ttmNumTicks = 20<br>  restick@ttmMajorStride= 48<br>  restick@ttmMinorStride= 24<br> timearr = ispan (1,696,1)<br> timearr@units = "hours since 2014-10-15 00:00:00"<br> time_axis_labels(timearr,res,<wbr>restick)<br>res@trXMaxF=max(timearr)<br>;res@tiMainString       = filename<br>;  res@tiYAxisString      = "PM 2.5 in ug/m^3"<br>  res@tiMainFontHeightF  = 0.05<br>  res@tiYAxisFontHeightF = 0.05<br>  res@tmXBLabelFontHeightF = 0.05<br>;  res@tmYLLabelFontHeightF = 0.05<br>  res@tmYUseLeft           = False   ; Make right axis independent of left<br>  res@tmYLOn               = False   ; Turn off left tickmarks<br>  res@tmYROn               = True    ; Turn on right tickmarks<br>  res@tmXTOn               = False   ; Turn off top tickmarks<br>  res@tmYLLabelsOn         = False   ; Turn off left labels<br>  res@tmYRLabelsOn         = True    ; Turn on right labels<br>  res@tmYRMinorOn          = False   ; Turn off minor ticks on Y axis<br>  res@tmYRLabelFontHeightF = 0.04   ; Increase font height<br>  res@tmYRLabelDeltaF      = 2.0     ; Increase space b/w ticks and labels<br>  res@tmYRLabelJust        = "CenterRight"   ; right-justify labels<br>  ;res@tmXBMajorOutwardLengthF = 0.0               ; draw tickmarks inward<br>  ;res@tmXBMinorOutwardLengthF = 0.0               ; draw minor ticks inward<br>  ;res@gsnPanelYWhiteSpacePercen<wbr>t = 0.0<br>  res@gsnBoxMargin = 0.0<br>  res@pmLegendDisplayMode    = "Always"            ; turn on legend<br>  res@pmLegendSide           = "Top"               ; Change location of<br>  res@pmLegendParallelPosF   = .90                  ; move units right<br>  res@pmLegendOrthogonalPosF = 0               ; move units down<br>  res@pmLegendWidthF         = 0.3                ; Change width and<br>  res@pmLegendHeightF        = 0.3                ; height of legend.<br>  res@lgPerimOn              = False               ; turn off box around<br>  res@lgLabelFontHeightF     = .03                 ; label font height<br>  res@xyExplicitLegendLabels = (/"baseline","APEC-control","O<wbr>ct-control","obs"/)         ; create explicit labels<br>  res@gsnDraw  = False                          ; don't draw<br>  res@gsnFrame = False                          ; don't advance frame<br>; Change y axis string and color for each plot.<br>  res@tiYAxisString = "OC"<br>  xy1 = gsn_csm_xy(wks,timearr,var_mat<wbr>rix_oc,res)    ; Create the four plots.<br>  res@pmLegendDisplayMode    = "Never"            ; turn off legend for subsequent plots<br>  res@tiYAxisString = "NO3"<br>  xy2 = gsn_csm_xy(wks,timearr,var_mat<wbr>rix_no3,res)<br>  res@tiYAxisString = "SO4"<br>  xy3 = gsn_csm_xy(wks,timearr,var_mat<wbr>rix_so4,res)<br>  res@tiYAxisString = "NH4"<br>  xy4 = gsn_csm_xy(wks,timearr,var_mat<wbr>rix_nh4,res)<br><br>;*****************************<wbr>*******************<br>; create panel<br>;*****************************<wbr>*******************<br>  resP                    = True                 ; modify the panel plot<br>  resP@gsnPanelMainString = "Surface pollutants at IAP site"     ; set main title<br>  gsn_panel(wks,(/xy1,xy2,xy3,xy<wbr>4/),(/4,1/),resP)             <wbr>  ; now draw as one plot</font></span></i><br><br><br></div><div style="font-family:trebuchet ms,sans-serif">Please let me know what can I change here to get the desired result.<br><br></div><div style="font-family:trebuchet ms,sans-serif">Thanks<br><br></div><div style="font-family:trebuchet ms,sans-serif">Tabish<br><br><br clear="all"></div><div><div class="m_3677755809093186329m_-6491230334574750743m_-4087701417135679574m_-9146751114572142842gmail_signature"><div dir="ltr"><div><div><font size="1"><span style="font-family:tahoma,sans-serif">Tabish U Ansari<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">PhD student, Lancaster Environment Center<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">Lancaster Univeristy<br> <span>Bailrigg</span>, <span>Lancaster</span>, <br><span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br></div></div></div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div><br></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div>