[pyngl-talk] Tickmarks in map plots

Mary Haley haley at ucar.edu
Tue Feb 24 15:48:23 MST 2015


Hi Martin,

Unfortunately map tickmarks and grid lines are not as customizable as they
are with XY, contour, and vector plots. We have it on our list to clean up
the map tickmarks, but just haven't had time to get to it yet.

I created an example that shows how you can use the "blank_plot" function
to create the map tickmark labels you want, and then add_polyline to create
the lat/lon grid lines you want.

This example will only work with with cylindrical equidistant maps.  If I
have the time, I will try to finish the python code I started for creating
even more custom tickmark labels like what you see with these NCL examples:

http://www.ncl.ucar.edu/Applications/Images/mptick_9_1_lg.png
http://www.ncl.ucar.edu/Applications/Images/mptick_10_1_lg.png

--Mary




On Fri, Feb 20, 2015 at 4:09 AM, Martin Claus <mclaus at geomar.de> wrote:

> Hi,
>
> I would like to adjust Tickmarks in a plot produced by a call to
> contour_map to match the grid lines drawn on the map.
> In NCL I would use gsnMajorLatSpacing, unfortunately this is not
> implemented in PyNgl. Is there any way to manipulate the Tickmarks in a
> map plot, since tickmark/gridline mismatch is particularly annoying in
> orthographic plots.
>
> Here is a small script to illustrate the problem:
>
>
> import numpy as np
>
> import Ngl
>
> sst = np.random.randn(10, 10)
>
> wks_type = "pdf"
>
> wks = Ngl.open_wks(wks_type,"test")
>
> res = Ngl.Resources()
>
> res.mpGridLatSpacingF = 20.
>
> map = Ngl.contour_map(wks,sst,res)
>
> Ngl.end()
>
>
>
> PyNGL version: 1.4.0
>
> Best regards,
> Martin
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20150224/4262699d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map3.2.png
Type: image/png
Size: 60045 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20150224/4262699d/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map3.1.png
Type: image/png
Size: 56314 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20150224/4262699d/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map3.py
Type: text/x-python-script
Size: 5048 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20150224/4262699d/attachment-0001.bin 


More information about the pyngl-talk mailing list