Re: how to adjust the tick mark on map

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 15 2013 - 12:43:17 MST

Dear Ziqiang,

NCL doesn't allow you much control over map tickmarks. We've written some examples showing how you can add your own map tickmarks using a rather complicated method of creating a "blank" plot with the desired tickmarks, and then adding this as an annotation.

See example "mptick_9.ncl" at:

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

I was able to take the "add_map_tickmarks" function straight out of this example and use it for your code, which I've attached here.

The key is that after you create the map, you need to add the following lines to add the new map tickmarks:

;---Indicate where we want tickmarks
   res@tmYLValues = ispan(30,33,1)
   res@tmYRValues = ispan(30,33,1)
   res@tmXBValues = ispan(117,123,1)
   res@tmXTValues = ispan(117,123,1)
   res@tmYLLabelFontHeightF = 0.01
   res@tmXBLabelFontHeightF = 0.01

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

Of course, you can change the values above as you see fit.

--Mary

On Nov 15, 2013, at 1:00 AM, JiangZiqiang <zqjiang86@hotmail.com> wrote:

> Dear Sil,
>
> I'm sorry for overdue reply.
> I tested your method. However it does not work.
> data, ncl and pdf file had been sent to you in the attachment.
>
> Thank you for your efforts all the time.
> Have a great day!
>
> Best,
> Ziqiang
>
>
> > Date: Sun, 10 Nov 2013 10:31:37 -0500
> > Subject: Re: how to adjust the tick mark on map
> > From: eunsil.jung@gmail.com
> > To: zqjiang86@hotmail.com
> > CC: ncl-talk@ucar.edu
> >
> > Dear Ziqiang
> >
> > Will you try either (1) or (2)
> >
> > (1)
> > res@tmYLMode = "Manual" ; Manually set tickmarks on Y axis
> > res@tmYLTickSpacingF = 1 ; Only set spacing, not start/end
> >
> > (2)
> > res@tmYLMode = "Explicit" ; Set labels for YL axis
> > res@tmYLValues = (/ 30, 31, 32, 33/)
> > res@tmYLLabels = (/"30N", "31N", "32N", "33N"/)
> >
> > #1 works usually, but I used # (2) when I plot hovmoller diagram
> >
> > If either of them does not work, could you send your code for plotting part?
> >
> > Thanks
> > Have a great day!
> > Sil
> >
> >
> > On 11/10/13, JiangZiqiang <zqjiang86@hotmail.com> wrote:
> > > Dear Sil,
> > > Thank your for your help.
> > > some warnings appeared, and it does not work.warning:MapPlotSetValues:
> > > tm[XB|XT|YL|YR]Mode resources are not currently enabled for MapPlot tick
> > > markswarning:tmYLValues is not a valid resource in map at this
> > > timewarning:tmYLLabels is not a valid resource in map at this time
> > > It seems that tmYLMode resource is not suitable for Lambert Conformal
> > > Project.I don't know why? Perhaps the example below is good. It looks like
> > > complicated.http://www.ncl.ucar.edu/Applications/mptick.shtml (mptick_10.ncl
> > > )
> > > Best,Ziqiang
> > >
> > >> Date: Sat, 9 Nov 2013 08:21:59 -0500
> > >> Subject: Re: how to adjust the tick mark on map
> > >> From: eunsil.jung@gmail.com
> > >> To: zqjiang86@hotmail.com
> > >> CC: ncl-talk@ucar.edu
> > >>
> > >> Hi, Ziqiang
> > >>
> > >> I'm new to NCL, so not sure it will work in your code or not, but try
> > >> this.
> > >>
> > >> res@tmYLMode = "Explicit"
> > >>
> > >> res@tmYLValues = (/real values that should be there/)
> > >>
> > >> res@tmYLLabels = (/"whatever you want to appear in Y axis such as 30N"/)
> > >>
> > >> and you may want to check this address. There are many examples about
> > >> the Tick marks.
> > >> http://www.ncl.ucar.edu/Applications/tickmarks.shtml
> > >>
> > >> Hope it helps.
> > >> Sil
> > >>
> > >> On 11/9/13, JiangZiqiang <zqjiang86@hotmail.com> wrote:
> > >> > Dear all,
> > >> > How to set lat/lon to 1 degree spacing on map?I tested some resources
> > >> > such
> > >> > as tmYLLabelStride=2 and tmYLTickSpacingF=2 etc.However it does not
> > >> > work.I
> > >> > want to set YL axis to 30/31/32/33¡ã
> > >> > Thanks for your time.Ziqiang
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> ------------------------------------------------------------------------------------------------
> > >> Be joyful always; pray continually; give thanks all circumstances.
> > >>
> > >> RSMAS/MPO
> > >> 4600 Rickenbacker cswy
> > >> Miami FL 33149
> > >>
> > >> Phone:
> > >> Cell : 1-305-987-1415
> > >> Office: 1-305-421-4036
> > >> Home: 070-8635-1518
> > >>
> > >>
> > >> Eunsil Jung
> > >
> >
> >
> > --
> > ------------------------------------------------------------------------------------------------
> > Be joyful always; pray continually; give thanks all circumstances.
> >
> > RSMAS/MPO
> > 4600 Rickenbacker cswy
> > Miami FL 33149
> >
> > Phone:
> > Cell : 1-305-987-1415
> > Office: 1-305-421-4036
> > Home: 070-8635-1518
> >
> >
> > Eunsil Jung
> <test.nc><test.ncl><test.pdf>_______________________________________________
> 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

test.png
Received on Fri Nov 15 12:43:31 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST