Thanks Adam,<div style="font-size: 12pt; font-family: Arial;"><p><br></p><p style="font-size: 12pt; font-family: Arial;">I'm sorry I couldn't provide a clean MWE, but there is a lot of things (probably too many) going on in my script. I'm trying to customize the vp resources, but I feel that I have no control on those. No matter how I set vpXF and vpYF, the plot doesn't move up/down nor left/right. There is maybe something working under the hood I can't prevent. At this point, it's even pointless to use getvalues. Probably it's better to use gsn_panel like in https://www.ncl.ucar.edu/Applications/Scripts/panel_24.ncl.</p><p style="font-size: 12pt; font-family: Arial;"><br></p><p style="font-size: 12pt; font-family: Arial;">Cheers,</p><p style="font-size: 12pt; font-family: Arial;">Giorgio</p>        <br>        <blockquote style="font-size: 12pt; font-family: Arial;"><br>        <br>   ------ Messaggio Originale ------<br>   Da: asphilli@ucar.edu<br>   A: g.graffino@tim.it<br>Cc: ncl-talk@ucar.edu<br>   Inviato: Friday, July 9, 2021 7:08 PM<br>   Oggetto: Re: [ncl-talk] XY plot with multiple vertical axes<br>  <br>        <div dir="ltr">Hi Giorgio,<div>You have a lot going on in the code snippet you sent, with numerous calls to gsn_attach_plots and overlay. Yes, it is possible to do what you want, but as you can tell already there is a bit of art to this. I would recommend not setting gsnMaximize for anything (which you are not), and pay particular attention to the vpYF/vpHeightF settings for your various resource lists. The values should be identical across your resa, resb and rez resource lists, otherwise the sizes and locations of the plots will be different.  I'd try setting vpYF = 0.8 and vpHeightF = 0.6 to start. Finally, I would not call drawNDCGrids until right before the frame(wks) call as it freezes the size of the frame. That shouldn't affect anything with your script as you are not maximizing, but just to be sure I would move the call. </div><div><br></div><div>Hope the above helps!</div><div>Adam</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 7, 2021 at 5:33 AM Giorgio Graffino via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank"><span class="wt_Email">ncl-talk@mailman.ucar.edu</span><span></span></a>> wrote:<br></div><blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;"><p style="font-size: 12.0pt;font-family: Arial;">Dear NCL folks,</p><p style="font-size: 12.0pt;font-family: Arial;"><br></p><p style="font-size: 12.0pt;font-family: Arial;">I'm trying to draw a XY plot by attaching four subplots together and giving each of them its own vertical axis. This last point is particularly tricky. Taking inspiration from this example (<a href="https://www.ncl.ucar.edu/Applications/Scripts/xy_22.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/xy_22.ncl</a>), I'm trying now to draw individual vertical axis using gsn_blank_plot, but I can't make all the plots to arrange nicely (see <span style="font-family: arial , sans-serif;font-size: 12.0pt;">HadCM3_plot_temp_ohue.000003.png</span><span style="font-size: 12.0pt;font-family: Arial;">) even when I </span>explicitly<span style="font-size: 12.0pt;font-family: Arial;"> set the NDC coordinates of the main plot (see code snippet below). </span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-size: 12.0pt;font-family: Arial;"><br></span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-size: 12.0pt;font-family: Arial;">What I'd like to have is something like </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">HadCM3_plot_temp_ohue.000004.png, but with individual axes for each subplot. </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">Can it be done? Is there an easier way to get a nice result?</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;"><br></span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;">Cheers,</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;">Giorgio</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;"><br></span></p><p><span style="font-family: Arial;font-size: 12.0pt;">deltapl = fspan(0.2,0.8,5)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">; resa@gsnMaximize       = True                     </span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@gsnDraw           = False   ; Don't draw plot</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@gsnFrame          = False   ; Don't advance frame</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@gsnYRefLine       = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tiMainString      = ""</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tiMainFontHeightF = 0.015</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tiXAxisString     = ""</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tiYAxisString     = ""</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tiYAxisFontHeightF = 0.0125</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBMode          = "Explicit"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBLabelAngleF   = 45.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBLabelFontHeightF = 0.0125</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBLabelJust     = "TopRight"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBLabels        := (/"Pos","Neg"/)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXBValues        := (/0.8,1.2/)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXUseBottom      = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabelsOn      = True</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTMode          = "Explicit"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabelAngleF   = 45.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabelFontHeightF = 0.0125</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabelJust     = "BottomLeft"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabels        = labels1(0)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTValues        = 1.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmYLLabelFontHeightF = 0.0125</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trXMinF           = 0.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trXMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMaxF           = 0.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@vpHeightF         = 0.8</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@vpWidthF          = 0.15</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@vpXF              = 0.2</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@vpYF              = 0.8</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@xyMarkLineMode    = "Markers"                ; choose to use markers</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@xyMarkers         := markrs</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@xyMarkerColors    := (/"Black","Red","Pink","Grey"/)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@xyMarkerSizeF     = 0.015                    ; Marker size (default 0.01)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@xyMarkerThicknessF = 3.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">; resb@gsnMaximize       = True                     </span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@gsnDraw           = False   ; Don't draw plot</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@gsnFrame          = False   ; Don't advance frame</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@tiMainFontHeightF = 0.015</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trXMinF           = 0.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trXMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMaxF           = 0.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@xyMarkLineMode    = "Markers"                ; choose to use markers</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@xyMarkers         := markrs</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@xyMarkerColors    := (/"Purple","Blue","Cyan","Green"/)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@xyMarkerSizeF     = 0.015                    ; Marker size (default 0.01)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@xyMarkerThicknessF = 3.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@vpHeightF         = 0.8</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@vpWidthF          = 0.15</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@vpXF              = 0.2</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@vpYF              = 0.8</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@gsnDraw      = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@gsnFrame     = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXBOn       = False      ; Turn off X axis since it has already</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXBBorderOn = False      ; been drawn.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXBLabelsOn = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXTOn       = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXTBorderOn = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmXTLabelsOn = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYLOn       = True       ; Turn on left Y axis.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYLBorderOn = True</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYLLabelsOn = True</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYLLabelFontHeightF = 0.0125</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYROn       = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYRBorderOn = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@tmYRLabelsOn = False</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@vpHeightF    = 0.75</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@vpYF         = 0.85</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: Arial;font-size: 12.0pt;"><br></span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> </span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot1a = gsn_csm_xy(wks,transpose((/(/0.8,0.8,0.8,0.8/),(/0.8,0.8,0.8,0.8/)/)),transpose((/abs(tas_globalave_positiveforcing(0:6:2)),abs(tas_globalave_positiveforcing(0:6:2))/)),resa)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot1b = gsn_csm_xy(wks,transpose((/(/1.2,1.2,1.2,1.2/),(/1.2,1.2,1.2,1.2/)/)),transpose((/abs(tas_globalave_negativeforcing(0:6:2)),abs(tas_globalave_negativeforcing(0:6:2))/)),resb)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">; resa@tiMainString      = "HadCM3 -"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabels        = labels1(1)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@vpXF              = deltapl(1)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot2a = gsn_csm_xy(wks,transpose((/(/0.8,0.8,0.8,0.8/),(/0.8,0.8,0.8,0.8/)/)),transpose((/abs(sst_globalave_positiveforcing(0:6:2)),abs(sst_globalave_positiveforcing(0:6:2))/)),resa)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot2b = gsn_csm_xy(wks,transpose((/(/1.2,1.2,1.2,1.2/),(/1.2,1.2,1.2,1.2/)/)),transpose((/abs(sst_globalave_negativeforcing(0:6:2)),abs(sst_globalave_negativeforcing(0:6:2))/)),resb)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot2z = gsn_blank_plot(wks,resz)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">; resa@tiMainString      = "Seasonal Cycle"</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabels        = labels1(2)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMaxF           = 1.5</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@vpXF              = deltapl(2)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot3a = gsn_csm_xy(wks,transpose((/(/0.8,0.8,0.8,0.8/),(/0.8,0.8,0.8,0.8/)/)),transpose((/abs(trac_globalave_positiveforcing(0:6:2)),abs(trac_globalave_positiveforcing(0:6:2))/)),resa)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot3b = gsn_csm_xy(wks,transpose((/(/1.2,1.2,1.2,1.2/),(/1.2,1.2,1.2,1.2/)/)),transpose((/abs(trac_globalave_negativeforcing(0:6:2)),abs(trac_globalave_negativeforcing(0:6:2))/)),resb)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot3z = gsn_blank_plot(wks,resz)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">; resa@tiMainString      = ""</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@tmXTLabels        = labels1(3)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resa@trYMaxF           = 35.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resb@trYMaxF           = 35.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMinF           = 0.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@trYMaxF           = 35.</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> resz@vpXF              = deltapl(3)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot4a = gsn_csm_xy(wks,transpose((/(/0.8,0.8,0.8,0.8/),(/0.8,0.8,0.8,0.8/)/)),transpose((/abs(tas_ohue_positiveforcing(0:6:2)),abs(tas_ohue_positiveforcing(0:6:2))/)),resa)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot4b = gsn_csm_xy(wks,transpose((/(/1.2,1.2,1.2,1.2/),(/1.2,1.2,1.2,1.2/)/)),transpose((/abs(tas_ohue_negativeforcing(0:6:2)),abs(tas_ohue_negativeforcing(0:6:2))/)),resb)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> plot4z = gsn_blank_plot(wks,resz)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> overlay(plot1a,plot1b)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> overlay(plot2a,plot2b)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> overlay(plot3a,plot3b)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> overlay(plot4a,plot4b)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> drawNDCGrid(wks)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> attplot = gsn_attach_plots(plot1a,(/plot2a,plot3a,plot4a/),at_res,False)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> draw(plot1a)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> draw(plot2z)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> draw(plot3z)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> draw(plot4z)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">do i = 0, dimsizes(ypos1)-1</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> lb_res@lbFillColors     = colors(i)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> lb_res@lbLabelFontColor = colors(i)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> gsn_labelbar_ndc(wks,1,labels2(i),0.85,ypos1(i),lb_res)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">end do</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">do i = 0, dimsizes(ypos2)-1</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> mk_res@gsMarkerIndex    = markrs(i)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> gsn_polymarker_ndc(wks,0.875,ypos2(i),mk_res)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> gsn_text_ndc(wks,labels3(i),0.9,ypos2(i),tx_res)</span></p><p><span style="font-family: Arial;font-size: 12.0pt;">end do</span></p><p><span style="font-family: Arial;font-size: 12.0pt;"> frame(wks)</span></p>_______________________________________________<br> ncl-talk mailing list<br> <a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank"><span class="wt_Email">ncl-talk@mailman.ucar.edu</span><span></span></a><br> List instructions, subscriber options, unsubscribe:<br> <a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div><br><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"><span class="wt_Phone">303-497-1726</span><span></span> </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> <br>        </blockquote><br>        <br>        </div>