Re: Map Tickmarks using gsn_map

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 07 2010 - 08:28:53 MDT

Hi Daniel,

Please see example 9 at:

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

This is a bit complicated, unfortunately. You basically have to create a blank plot with the tickmarks you want,
and overlay this on the map. This example shows you how to do this.

You need to copy the "add_map_tickmarks" function to your own script,
and then call it as shown in this example.

You can control the size of the tickmark labels by setting:

  res@tmXBLabelFontHeightF

This will affect the other axes labels as well.

To control the length of the tickmarks, set:

 res@tmXBMajorOutwardLengthF
 res@tmXBOutwardLengthF

to the same value. Try a small value, like 0.01 and then work from there. This will propagate to the other tickmark lengths as well.

It's been on our "to do" list for awhile to add more customization for map tickmarks.

--Mary

On Jul 7, 2010, at 2:53 AM, <Daniel.Leuenberger@meteoswiss.ch> <Daniel.Leuenberger@meteoswiss.ch> wrote:

> Hello,
>
> I use gsn_map to plot a map and try to figure out how the tickmark
> spacing in lat and lon can be adjusted. I tried
>
> - tm resources: "tm[XB|XT|YL|YR]Mode resources are not currently enabled
> for MapPlot tick marks"
> - mpGridSpacingF which just adjusts the spacing of the lat/lon grid
> lines, but not the tick marks
> - gsnMajorLonSpacing: doesn't work either
>
> How can I adjust the tick mark spacing? Please find below my sample
> script.
>
> Thanks
> Daniel
>
> begin
>
> wks = gsn_open_wks("ps","test")
> r = True
> r@gsnMaximize = True
> r@gsnFrame = True
> r@gsnDraw = True
> r@tmYROn = False
> r@tmYLOn = True
> r@tmXTOn = False
> r@tmXBOn = True
> r@pmTickMarkDisplayMode = "Always"
> r@mpGridSpacingF = 4.0
> r@mpGridLineColor = "Gray"
> r@mpGridMaskMode = "MaskNone"
> r@mpLimbLineColor = "Gray"
> r@mpGridAndLimbOn = True
> r@mpNationalLineColor = "Gray"
> r@mpGeophysicalLineColor = "Gray"
> r@mpPerimLineColor = "Gray"
> r@mpPerimOn = False
> r@mpRightCornerLonF = 23.02349
> r@mpRightCornerLatF = 56.8411
> r@mpLeftCornerLonF = -9.798356
> r@mpLeftCornerLatF = 35.15828
> r@mpLimitMode = "Corners"
> r@mpCenterLatF = 47.0
> r@mpCenterLonF = 370.0
> r@mpPerimLineThicknessF = 1
> r@mpOutlineBoundarySets = "AllBoundaries"
> r@mpFillOn = False
> r@mpOutlineOn = True
> r@mpDataSetName = "Earth..4"
> r@mpDataBaseVersion = "MediumRes"
> mp = gsn_map(wks, "CylindricalEquidistant", r)
> delete(r)
>
> end
> ________________________________________
>
> Daniel Leuenberger
> Numerical Models
>
> Federal Departement of Home Affairs FDHA Federal Office of Meteorology
> and Climatology MeteoSwiss
>
> Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland
>
> Tel. +41 44 256 97 10
> Fax +41 44 256 92 78
> daniel.leuenberger@meteoswiss.ch
> www.meteoswiss.ch - First-hand information
>
> _______________________________________________
> 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 Jul 7 08:28:59 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 09 2010 - 16:06:22 MDT