[ncl-talk] gsn_panel plot functions

Adam Phillips asphilli at ucar.edu
Mon Apr 22 15:34:41 MDT 2024


Hi Mauro,
Thank you for supplying an easy to run version of your script; that always
makes it easier to see what is going on.
The typical workflow for workstations/panel plotting is:
1 - Open the workstation.  (wks = gsn_open_wks("ps","test")
2 - Create a graphic object plot array to hold the plots.   (plot =
new(15,graphic))
3 - Fill in the array created in 2 and associate it with the workstation
opened in 1.   plot(cntr) = gsn_csm_xy(wks,.....) )
4 - Call gsn_panel, specifying the workstation opened in 1) and the
plotting array created and filled in 2 and 3.
 (gsn_panel(wks,plot,(/5,3/),pancreas)

Your script contains numerous workstations (both x11 and png), you are
copying/moving plots around after their creation, and you are calling
gsn_panel while specifying a workstation different than that specified for
the individual plots.  While you can do some of this, it makes it rather
confusing to keep track of everything.  If you want to stick with the
structure of this script, I would not use x11 workstations. Use .ps or .png
instead, and only use 1 workstation if possible to keep things cleaner. I
think your main issue is how you are handling the workstations. It will
help to simplify that by shifting to a single workstation.  On a more minor
note, set gsnMaximize to False in the individual resource lists. When
paneling only set this resource to True in the panel resource list.

Hope that at least gets you going in the right direction!
Best,
Adam

On Mon, Apr 22, 2024 at 2:12 AM MORICHETTI MAURO via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

>
>
> Hello everyone,
>
> I'm encountering an issue with my script.
>
> I'm using two sets of data to create a boxplot and an XY graph for 5
> different case studies. The objective is to incorporate these two graphs
> into a panel plot similar to the example provided (rcp2p6_GPP.png).
>
> I understand that the script is not structured optimally, as I combined
> two separate scripts into one. The current problem arises when I attempt to
> include the individual plots in the panel using a final loop. It seems that
> the function is retaining the individual plots, resulting in the absence of
> the panel plots.
>
> I have attached the script and the data.
>
> Thank you in advance.
>
> Best regards,
>
> Mauro
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist IV, Climate Analysis Section
Climate and Global Dynamics Laboratory
National Center for Atmospheric Research
www.cgd.ucar.edu/staff/asphilli/

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240422/d6d3bc3d/attachment.htm>


More information about the ncl-talk mailing list