[ncl-talk] Lat/lon tickmark and labels on panel plots

Adam Phillips asphilli at ucar.edu
Fri Apr 13 11:48:50 MDT 2018


Hi Sam,
"In simple terms, I want to stop NCL from drawing a tickmark and associated
label when they're positioned less than a threshold distance away from the
relevant edge of the box, but can't seem to find a way of doing this. Can
anybody shed any light on the issue? It seems like this task should be
relatively easy to fix, but it's been bugging me for a while."
I do not know of a way to do this, so someone else will have to chime in
for help with that. However, I think there is a solution to your problem.

NCL assumes a single unit size for all paneled plots, and when the plot
sizes are different between plots (as they are in your case because the
lat/lon labels extending beyond the X/Y axis positions of the plot) it will
insure that labels do not run into one another.  There's a way around this
issue though by manually paneling everything. Take a look at Panel Example
#39 here:
http://www.ncl.ucar.edu/Applications/panel.shtml#ex39

I would recommend a similar approach, paneling manually using
vpXF/vpYF/vpHeightF/vpWidthF with the latter two having the exact same
value for each panel. (Note that when paneling manually vpWidthF
(vpHeightF) settings refer to the distance in NDC units between the two Y
(X) axes *not* taking into account tick mark labels, so you can set each
plot to be the same size.) The coding order would be similar to the
examples:
1 - call gsn_panel (with the gsnPanelDebug set to True) to get the
vpWidthF/vpHeightF values for each panel, and the vpXF and vpYF positions
of each row and column. You are doing this only for the output from
gsnDebugPanel.
2 - Set a single value for vpWidthF/vpHeightF that is used for every
paneled plot, based on the output from step one. These settings may require
some trial and error.
3 - Following the example and the information provided from step one, set
the X/Y location for every plot using vpXF/vpYF.

If your script will be run over and over again I believe steps two and
three code possibly be automated by writing the gsnDebugPanel information
to a file, reading that file in andparsing the information. This would take
some work though to make it happen.

Hope that helps!
Adam

On Fri, Apr 13, 2018 at 11:02 AM, Sam Hardy <S.Hardy1 at leeds.ac.uk> wrote:

> Hi ncl-talk,
>
>
> I'm trying to produce panel plots of basic variables, e.g.
> vertical velocity, for multiple ensemble members (see attached plot). I'm
> running NCL 6.4.0 (see attached script) on x86_64 GNU/linux.
>
>
> In each of the panels, the plot is centred on the location of the storm,
> so the lat/lon positions of each panel are slightly different. When the
> lat/lon tickmark labels are close to the edge of the domain (e.g. (d) in
> attached plot), the size of the panel is reduced relative to the other
> panels, producing uneven images.
>
>
> This issue isn't really noticeable until I increase the label font size to
> something readable using the 'tmXBLabelFontHeightF'/'tmXLLabelFontHeightF'
> resources, but obviously I'd like to be able to read the labels in the
> first place!
>
>
> In simple terms, I want to stop NCL from drawing a tickmark and associated
> label when they're positioned less than a threshold distance away from the
> relevant edge of the box, but can't seem to find a way of doing this. Can
> anybody shed any light on the issue? It seems like this task should be
> relatively easy to fix, but it's been bugging me for a while.
>
>
> I'm using 'gsn_panel' to produce the plots, but have also tried explicitly
> setting the panel positions and sizes using 'vpXF', 'vpYF', etc, without
> success. I've also tried setting 'tmXBMode = "Manual"' and using
> 'tmXBTickStartF', 'tmXBTickEndF', etc to force NCL to only put tick marks
> in specified locations, but haven't managed to fix the issue.
>
>
> The script I've attached plots a different variable (potential vorticity)
> and produces only 2 rather than 12 panels (to save time), but the issue is
> the same. I'll wait before ftp'ing the input files (> 4 GB each) because
> this isn't about finding a bug in the script, but more about guidance on
> which function to use.
>
>
> Thanks in advance for any help,
>
>
> Sam
>
>
> Sam Hardy
> Postdoctoral Researcher - Tropical Cyclone Intensification
>
>
> Institute for Climate and Atmospheric Science
> School of Earth and Environment
> University of Leeds
> Leeds
> LS2 9JT
>
> _______________________________________________
> 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/20180413/92b37750/attachment-0001.html>


More information about the ncl-talk mailing list