Re: Adjusting tickmark labels with gsn_csm_contour_map

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 01 2010 - 17:24:17 MDT

Hi Emilie,

It's not possible to control your own map tickmarks using the method you tried,
unfortunately. This has been on our list of things to improve for awhile now.

I created an example that shows how to create your own map tickmarks so
you can put the labels where you want them.

See example 9 at:

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

You will want to copy the "add_map_tickmarks" function to your own script,
and then call it as shown in this example. I used the same map resources
that you set for the first frame of 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.

--Mary

On Jul 1, 2010, at 9:01 AM, Emilie Vanvyve wrote:

> Hello,
>
> I am new to NCL and struggling to customise a simple plot. I am not doing
> anything fancy and don't understand why it doesn't work, hence this
> e-mail.
>
> The plot is simple, it shows the topography of the US. I am trying to make
> the lon/lat labels match the lon/lat grid lines overlaid on the filled
> contours. I can modify the grid lines to be every 10 degrees, but I can't
> modify the axis labels to match this (they are every 15 degrees in lon and
> 5 degrees in lat). Note that I could as well modify the grid lines spacing
> to match the labels, but this offers less flexibility.
>
> The topography is stored in the 'terrain' variable and is on a regular
> longitude-latitude grid. I plot these data with:
>
> plot = gsn_csm_contour_map(wks,terrain,res)
> draw(plot)
> frame(wks)
>
> where 'res' has previously been set as:
>
> res = True
> res@gsnDraw = False
> res@gsnFrame = False
>
> res@mpProjection = "LambertConformal"
> res@mpLambertParallel1F = 10
> res@mpLambertParallel2F = 70
> res@mpLambertMeridianF = -100
> res@mpLimitMode = "LatLon"
> res@mpMinLatF = 20
> res@mpMaxLatF = 55
> res@mpMinLonF = -140
> res@mpMaxLonF = -60
> res@mpGridAndLimbOn = True
> res@mpGridSpacingF = 10.
> res@pmTickMarkDisplayMode = "Always"
>
> res@tmXBMode = "Manual" ; I also tried "Explicit"
> res@tmXBTickStartF = -130.
> res@tmXBTickSpacingF = 10.
> res@tmYLMode = "Manual"
> res@tmYLTickStartF = 20.
> res@tmYLTickSpacingF = 10.
>
> res@cnFillOn = True
> res@cnLinesOn = False
>
> At execution of the script, I get:
>
> warning:MapPlotSetValues: tm[XB|XT|YL|YR]Mode resources are not
> currently enabled for MapPlot tick marks
>
> I guess that's why it doesn't work, but why does this message appear and
> how can I solve my problem?
>
> Sorry if this has already been asked, I did look through the on-line
> documentation and previous e-mail messages, but couldn't find any
> explanation (that I understand).
>
> Thanks in advance for any help,
> Emilie
>
> _______________________________________________
> 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 Thu Jul 1 17:24:23 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 02 2010 - 07:45:13 MDT