Mira, <div><br></div><div>You set res and have the gsnDraw and gsnFrame set right but you never use it.</div><div><br></div><div>Easiest fix would be to set "vcres = res" instead of "vcres = True".</div><div><br></div><div>This should be the only thing you need to fix it.</div><div><br></div><div>-Alex</div><div><br>On Sunday, June 7, 2015, <<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
I am trying to make a simple panel plot, but instead of just getting a<br>
single panel plot, I get every image on a separate page of the ps file,<br>
followed finally by the panel plot at the end. The code here shows that I<br>
do a seasonal average of winds, and want to plot all four seasons as<br>
panels. However the pdf file this script outputs is 5 pages long - first<br>
four pages are a plot for each season, followed by the panel plot at the<br>
end. Is there something in my script that is causing each figure to print<br>
individually before finally printing in the panel?<br>
Thanks for any help!<br>
Mira<br>
<br>
********************************************************************<br>
<br>
<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
;************************************************<br>
begin<br>
;************************************************<br>
; read in netCDF file<br>
;************************************************<br>
a = addfile("<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>","r")<br>
print(a)<br>
b = addfile("<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.mean.nc</a>","r")<br>
<br>
;************************************************<br>
; read in zonal [u] and meridional [v] winds (July)<br>
;************************************************<br>
<br>
u = a->uwnd(0:803,{45:90},{270:357.5})<br>
v = b->vwnd(0:803,{45:90},{270:357.5}) ; Get u, v, time (1948:2014),level<br>
(1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
<br>
printVarSummary(u)<br>
printVarSummary(v)<br>
<br>
; to take the average over the first dimensions (time)<br>
;uAvgTime = dim_avg_n_Wrap(u,0)<br>
;vAvgTime = dim_avg_n_Wrap(v,0)<br>
<br>
;printVarSummary(vAvgTime)<br>
;printVarSummary(uAvgTime)<br>
<br>
; calculate speed from u and v components<br>
;speed = sqrt(uAvgTime^2+vAvgTime^2)<br>
<br>
; Calculate the seasonal averages.<br>
uDJF = month_to_season(u, "DJF")<br>
vDJF = month_to_season(v, "DJF")<br>
uMAM = month_to_season(u, "MAM")<br>
vMAM = month_to_season(v, "MAM")<br>
uJJA = month_to_season(u, "JJA")<br>
vJJA = month_to_season(v, "JJA")<br>
uSON = month_to_season(u, "SON")<br>
vSON = month_to_season(v, "SON")<br>
<br>
;printVarSummary(uDJF)<br>
;printVarSummary(vDJF)<br>
<br>
<br>
<br>
uAvgTime_DJF = dim_avg_n_Wrap(uDJF,0)<br>
vAvgTime_DJF = dim_avg_n_Wrap(vDJF,0)<br>
<br>
uAvgTime_MAM = dim_avg_n_Wrap(uMAM,0)<br>
vAvgTime_MAM = dim_avg_n_Wrap(vMAM,0)<br>
<br>
uAvgTime_JJA = dim_avg_n_Wrap(uJJA,0)<br>
vAvgTime_JJA = dim_avg_n_Wrap(vJJA,0)<br>
<br>
uAvgTime_SON = dim_avg_n_Wrap(uSON,0)<br>
vAvgTime_SON = dim_avg_n_Wrap(vSON,0)<br>
<br>
<br>
;************************************************<br>
; create plot<br>
;************************************************<br>
wks = gsn_open_wks("ps","Panel_seasonalMean") ; open a ps file<br>
plot = new(4,graphic) ; create a plot array<br>
<br>
res = True<br>
res@gsnDraw = False ; dont draw<br>
res@gsnFrame = False ; dont advance frame<br>
res@cnInfoLabelOn = False ; trn off cn info label<br>
<br>
vcres = True ; plot mods desired<br>
vcres@gsnAddCyclic = False ; has to do with wrapping the longitude at 0/360<br>
vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
vcres@vcRefLengthF = 0.045 ; define length of vec ref<br>
vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
vcres@vcMinDistanceF = 0.017<br>
<br>
;************************************************<br>
; Choose a subregion<br>
;************************************************<br>
vcres@mpFillOn = False ; turn off gray fill<br>
vcres@mpOutlineBoundarySets = "National" ; turn on country boundaries<br>
vcres@mpGeophysicalLineColor = "Navy" ; color of cont. outlines<br>
vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines<br>
<br>
vcres@mpMaxLatF = 90 ;maximum latitude<br>
vcres@mpMinLatF = 45 ;minimum latitude<br>
vcres@mpMaxLonF = 357.5 ;maximum longitude<br>
vcres@mpMinLonF = 270 ;minimum longitude<br>
<br>
plot(0) = gsn_csm_vector_map_ce(wks,uAvgTime_DJF,vAvgTime_DJF,vcres)<br>
plot(1) = gsn_csm_vector_map_ce(wks,uAvgTime_MAM,vAvgTime_MAM,vcres)<br>
plot(2) = gsn_csm_vector_map_ce(wks,uAvgTime_JJA,vAvgTime_JJA,vcres)<br>
plot(3) = gsn_csm_vector_map_ce(wks,uAvgTime_SON,vAvgTime_SON,vcres)<br>
<br>
<br>
;************************************************<br>
; create panel<br>
;************************************************<br>
resP = True ; modify the panel plot<br>
resP@txString = "Seasonal Mean Winds"<br>
gsn_panel(wks,plot,(/4,1/),resP) ; now draw as one plot<br>
<br>
<br>
<br>
end<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'ncl-talk@ucar.edu')">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>