Re: setting major and minor lat/lon spacing

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed May 28 2014 - 08:08:02 MDT

Hi Frank,

There are two types of map tickmarks that you can get with the gsn_xxxx scripts.

The default map tickmarks, which don't have degree symbols, recognize the resources you're using.

Under the hood, in the gsn_code.ncl script, these map tickmarks are created by hand, because at the time, we had no automatic way to get tickmarks on maps. This is the code that recognizes the gsnMajor/Minor resources,

A few years later Dave created a way to get automatic tickmarks that give you the nice degree symbol. These are the tickmarks that you get when you set:

   res@pmTickMarkDisplayMode = "Always"

These tickmarks are actually part of the TickMark object, and are not created by gsn_code.ncl,and hence they don't recognize any of the gsnMajor/Minor resources. These tickmarks are not very customizable unfortunately.

If you want more custom tickmarks, see example mptick_9.ncl at:

http://www.ncl.ucar.edu/Applications/mptick.shtml#ex9

You will need to copy the "add_map_tickmarks" function to the top of your script, and then call it after you create your map, with something like:

  res@tmYLValues = ispan(51,53,1) ; this gives you tickmarks and labels at 51, 52, and 53
  res@tmXBValues = ispan(11,15,1) ; 11, 12, 13, 14, 15

;---Attach the new map tickmarks.
  map = add_map_tickmarks(wks,map,res)

You can look at examples mptick_10 and mptick_11 for other methods.

--Mary

On May 27, 2014, at 11:26 PM, Kreienkamp Frank <Frank.Kreienkamp@dwd.de> wrote:

> Hello,
>
> i have a map in stereographic projection (see attached png.file). The
> system is automatically adding a setting for major and minor lat/lon
> labels.
>
> Using the lines:
> res@gsnMajorLatSpacing = 1
> res@gsnMinorLatSpacing = 1
> res@gsnMajorLonSpacing = 1
> res@gsnMinorLonSpacing = 1
> i try to change the default setting. Unfortunately i get the following
> warnings and nothing happens.
>
> warning:gsnMajorLatSpacing is not a valid resource in map at this time
> warning:gsnMajorLonSpacing is not a valid resource in map at this time
> warning:gsnMinorLatSpacing is not a valid resource in map at this time
> warning:gsnMinorLonSpacing is not a valid resource in map at this time
> warning:gsnMajorLatSpacing is not a valid resource in
> temp-develop_contour at this time
> warning:gsnMajorLonSpacing is not a valid resource in
> temp-develop_contour at this time
> warning:gsnMinorLatSpacing is not a valid resource in
> temp-develop_contour at this time
> warning:gsnMinorLonSpacing is not a valid resource in
> temp-develop_contour at this time
>
> What can i do to manually define the lat/lon label spacing? I want to
> have only full degree labels 52 and 53°N.
>
> Thanks in advance
> Frank
>
>
>
>
>
>
> --
> ++++++++++++++++++++++++++++++++++++++++++++
> Dr. Frank Kreienkamp
> Deutscher Wetterdienst (DWD)
> Abteilung Klima- und Umweltberatung
> Sachgebiet Klimaprojektionen und Klimavorhersagen
>
> Michendorfer Chaussee 23
> 14473 Potsdam
>
> Tel.: ++49(0)331-316-346
> E-Mail: frank.kreienkamp@dwd.de
> ++++++++++++++++++++++++++++++++++++++++++++
> <temp-develop.ncl><temp-develop.png>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 28 08:08:22 2014

This archive was generated by hypermail 2.1.8 : Tue Jun 03 2014 - 11:40:09 MDT