[ncl-talk] zonal mean in panel

Adam Phillips asphilli at ucar.edu
Mon Jul 30 11:02:50 MDT 2018


Hi Christine,
Paneling plots of different sizes and getting them to look exactly how you
want can take some trial and error. I would panel the three maps separately
and set gsnPanelDebug = True in your panel resource list, not advance the
frame, then use the settings output from gsnPanelDebug to set whichever of
the vpWidthF/vpHeightF/vpXF/vpYF settings you want to use. So the procedure
would look loosely like this:

res = True
res at gsnDraw = False
res at gsnFrame = False
...
plot = new(4,graphic)
plot(0) = gsn_csm_contour_map(wks...
; do not create plot(1) to leave a space in the upper right hand corner of
the plot
plot(2) = gsn_csm_contour_map(wks...
plot(3) = gsn_csm_contour_map(wks...

panres = True
panres at gsnFrame = False
panres at gsnPanelDebug = True
gsn_panel(wks,plot,(/2,2/),panres)
drawNDCGrid(wks)    ; draws the NDC grid on the plot to help place xy plot.
Can remove when not needed

; Look at the output from gsnPanelDebug (see:
http://www.ncl.ucar.edu/Applications/panel.shtml#ex19) and set the vp
resources below
xyres = True   ; zonal mean resource list, will pass into gsn_csm_xy
xyres at gsnFrame = False
xyres at vpXF = 0.6   ; set these based on the dimensions from gsnPanelDebug
for plot(0).
xyres at vpYF = 0.9
xyres at vpWidthF = 0.2
xyres at vpHeightF = 0.4
...
xyplot = gsn_csm_xy(wks,.....
frame(wks)

As stated earlier, this will take some trial and error to get the vp
settings exactly how you want them. Please respond to ncl-talk with any
further queries. Good luck!
Adam

On Mon, Jul 30, 2018 at 3:10 AM christine Delire <cdelire at gmail.com> wrote:

> I am trying to build a panel with 3 maps and a zonal mean of lets say the
> upper left map.
> The 1st map on the top left would be observations.
> On the second row, I'd want a model simulation on the left and simulated
> minus observed on the right.
> This I can do. But I'd like to add a zonal mean on the top right that has
> the zonal averages of the observed and simulated fields.
>
> I tried *gsn_csm_attach_zonal_means*, and *overlay* to get several zonal
> means on the same plot but map+zonal means had the same size as the lower
> map. So the upper map  is smaller than the lower one and I don't want that.
>
> I tried to calculate the zonal mean and plot them on the upper right panel
> with* gsn_csm_xy *using panel_14.ncl as example but couldn't get to place
> the xy plot correctly.
>
> Finally, I also tried to follow panel_20.ncl but all my plots appear
> exactly at the same place on top of each other despite carefully defining
> the vpXF etc. the vp ressources don't seem to work at all.
>
> I am using version 6.4.0
>
> Any hint ?
>
>
> --
> Christine Delire,
> cdelire at gmail.com
> Toulouse
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180730/10767a7f/attachment.html>


More information about the ncl-talk mailing list