Re: map contour lat/long labels

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu May 09 2013 - 11:08:45 MDT

Hi Nick,

The secondary tickmarks are minor tickmarks. I believe you can turn these off with
res@tmXBMinorOn = False and
res@tmYLMinorOn = False

--Mary

On May 8, 2013, at 8:30 PM, Nick Guy wrote:

> Thank you Mary. I wanted to get the 'E-W' and 'N-S' on the axis titles, so I did the following:
> ==================================================
> ; Set the latitude and longitude spacing for tickmarks
> dlat=.2
> dlon=.4
>
> And then tried to get tricky by calculating my own tick mark values and use XBMode="Explicit"
> This is all starts around line 269 of the attached code.
>
> I've also attached the plot. One issue I can't find is why there are secondary tick marks showing up on each axis. Any idea what is causing that?
>
> All the best,
>
> Nick Guy, Ph.D.
> NOAA National Severe Storms Laboratory
> NOAA/NSSL/WRDD
> 120 David L. Boren Blvd.
> Norman, OK 73072
> (405)325-6287
> nick.guy@noaa.gov
>
> <dBZ_horiz_dBZ_DYNAMO.ps>
> <plot_p3_horiz_dynamo.ncl>
>
> On May 7, 2013, at 9:35 AM, Mary Haley wrote:
>
>> Hi Nick,
>>
>> The mpGridXXX resources are for the lat/lon grid lines, and not for the tick mark labels.
>>
>> The tickmarks and labels for a GSN-based CE map can be controlled with the standard tmXXX resources:
>>
>> res@tmXBMode = "Explicit"
>> res@tmXBValues = ispan(20,30,1)
>> res@tmXBLabels = "" + res@tmXBValues
>>
>> See example mptick_6.ncl at:
>>
>> http://www.ncl.ucar.edu/Applications/mptick.shtml
>>
>> You can also try setting:
>>
>> res@pmTickMarkDisplayMode = "Always"
>>
>> this will give you nice tickmark labels with degrees and minutes.
>>
>> To try it out, run this script:
>>
>> . . .
>> wks = gsn_open_wks("x11","mptick")
>>
>> res = True
>> res@mpMinLatF = 20
>> res@mpMaxLatF = 21
>> res@mpMinLonF = 20
>> res@mpMaxLonF = 21
>>
>> ; These four resources don't work with pmTickMarkDisplayMode = "Always"
>> ; res@tmXBMode = "Explicit"
>> ; res@tmXBValues = ispan(200,210,1)/10.
>> ; res@tmXBLabels = "" + res@tmXBValues
>> ;
>> ; Use tmYLXXXX for Y axis.
>>
>> res@pmTickMarkDisplayMode = "Always"
>>
>> plot = gsn_csm_map_ce(wks,res) ; draw global map
>> . . .
>>
>>
>> --Mary
>>
>>
>>
>> On May 6, 2013, at 9:57 AM, Nick Guy wrote:
>>
>>> Hi all,
>>>
>>> I am contouring data onto a cylindrical map projection using the gun_csm_contour_map_ce function. I would like to adjust the the lat and lon labels to tenths of a degree, but it seems that only whole numbers are allowed (e.g. mpGridLatSpacingF)? Is there a way to label sub-degree?
>>> My 'dBZ' data has coordinate variables with units "degrees_north" and "degrees_east" for lat and lon, respectively.
>>> My plotting code is below.
>>> ;==================================================
>>> ...
>>> resHor=True
>>> resHor@gsnDraw=False
>>> resHor@gsnFrame=False
>>> resHor@tiXAxisFontHeightF=.015
>>> resHor@tiYAxisFontHeightF=.015
>>> resHor@gsnLeftString=mms+"/"+dds+"/"+yys ; Make own label
>>> resHor@gsnLeftStringFontHeightF=.023 ; Shrink the font size
>>> resHor@gsnRightString=t_start+"-"+t_end+" UTC" ; Make own label
>>> resHor@gsnRightStringFontHeightF=.023 ;Shrink the font size
>>> resHor@gsnSpreadColors=False ; True=Use the full range of colormap
>>>
>>> resHor@cnFillOn=True ; Turn on color
>>> resHor@cnLinesOn=False ; Turn off contour lines
>>> resHor@cnLineLabelsOn=False ; Turn off line labels
>>> resHor@cnInfoLabelOn=False ; Turn of contour label info
>>> resHor@cnLevelSelectionMode="ExplicitLevels" ; User defined levels
>>> resHor@cnLevels=clevs_dBZ ; Set contour levels
>>>
>>> resHor@lbLabelBarOn=False ; Turn off label bar and plot just 1 for panel
>>> resHor@mpLimitMode="LatLon"
>>> resHor@gsnAddCyclic=False
>>> resHor@mpMinLonF=min(XLon)-(.05*(abs(max(XLon)-min(XLon))))
>>> resHor@mpMaxLonF=max(XLon)+(.05*(abs(max(XLon)-min(XLon))))
>>> resHor@mpMinLatF=min(YLat)-(.05*(abs(max(YLat)-min(YLat))))
>>> resHor@mpMaxLatF=max(YLat)+(.05*(abs(max(YLat)-min(YLat))))
>>> resHor@mpGridLonSpacingF=1. ; Can't get less than 1 degree??
>>> resHor@mpGridLatSpacingF=1.
>>>
>>> panID(ii)=gsn_csm_contour_map_ce(wks,dBZ(Zind,:,:),resHor)
>>> ;====================================================
>>> Thanks!
>>>
>>> Nick Guy, Ph.D.
>>> NOAA National Severe Storms Laboratory
>>> NOAA/NSSL/WRDD
>>> 120 David L. Boren Blvd.
>>> Norman, OK 73072
>>> (405)325-6287
>>> nick.guy@noaa.gov
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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 May 9 11:08:52 2013

This archive was generated by hypermail 2.1.8 : Wed May 15 2013 - 10:19:28 MDT