Re: How to Replace default Y-axis labels and tickmarks ?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 04 2013 - 09:04:50 MDT

Helen,

It looks like you are setting the tickmark resources correctly.

Are you getting any kind of warning or error at all?

You have to be sure that the values you use for tmYLValues correspond with the range of the Y aixs.

Also, don't set tmLabelAutoStride when you are in "explicit" mode.

See attached example and data file.

--Mary

On Sep 4, 2013, at 5:06 AM, Helen Parish wrote:

> I am trying to modify the Y-axis label and tickmarks from the default
> for a Hovmuller style plot, but cannot find a way to get it to replace
> the default label and tickmarks with my chosen explicit values. I can
> either eliminate the Y label and tick marks completely, or have both
> labels appear together. Also, if tick marks are not completely
> eliminated, both sets of tickmarks are present and the core is dumped.
> I have tried using both gsn_csm_hov and gsn_csm_contour, but the
> default Y-axis values seem to be forced in both cases.
>
> Does anyone know how I can replace the default Y-axis label and
> tickmarks ?.
>
> I enclose the part of the script which creates the plot below, and
> below that I enclose summaries of the variables which are used.
>
> Thanks,
> Helen.
>
>
>
> ;***********************
> ; Create Plot
> ;***********************
>
> res = True
>
> res@gsnLeftString = ""
> res@gsnCenterString = "Hovmuller Plot T-Ttime-mean"
> res@gsnRightString = ""
>
> res@cnFillOn = True
> res@lbLabelAutoStride = True
> res@gsnMaximize = True ; if [ps, eps, pdf] make large
> res@gsnSpreadColors = True ; span color map
> res@cnLineLabelsOn = False ; Turn off contour line labels
> res@cnInfoLabelOn = False ; Turn off informational label
>
> time3 = time2
> time3 = (time2-36155.0)/365.0
> timlabel = time3
>
> timlabel(0) = time3(0)
> timlabel(1) = time3(10)
> timlabel(2) = time3(20)
> timlabel(3) = time3(30)
> timlabel(4) = time3(40)
> timlabel(5) = time3(51)
>
> labsy = (/"0.0","10.0","20.0","30.0","40.0","50.0"/)
> res@tmYLMode = "Explicit" ; explicit labels
> res@tmYLValues = timlabel(0:5) ; location of labels
> res@tmYLLabels = labsy ; labels themselves
> res@tmLabelAutoStride = True ; nice stride on
> labels
>
> res@tmXBMode = "Manual"
> res@tmXBTickStartF = 0
> res@tmXBTickEndF = 50
> res@tmXBTickSpacingF= 5
>
> res@tiXAxisString = "Longitude (degrees)"
> res@tiYAxisString = "Time (years from year 100)"
>
> res@pmTitleZone = 3
> res@pmLabelBarOrthogonalPosF = 0.05
>
> res@lbTitleOn = True
> res@lbTitleDirection = "Across" ; title direction
> res@lbTitlePosition = "Right"
> res@lbTitleString = "(K)"
> res@lbTitleFontHeightF = 0.02
> res@lbTitleOffsetF = 0.0
>
> plot = gsn_csm_contour(wks, tdiff(:,19,95,:), res ) ;
> (time,lon)
>
> end
>
>
>
> Variable: tdiff
> Type: float
> Total Size: 575078400 bytes
> 143769600 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 52] x [lev | 50] x [lat | 192] x [lon |
> 288]
> Coordinates:
> time: [36166.66666666666..54833.33333333334]
> lev: [0.03554912016..91942.93428213599]
> lat: [ -90.. 90]
> lon: [ 0..358.75]
> Number Of Attributes: 3
> cell_methods : time: mean
> long_name : Temperature
> units : K
>
>
> Variable: time2
> Type: double
> Total Size: 416 bytes
> 52 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 52]
> Coordinates:
> time: [36166.66666666666..54833.33333333334]
> Number Of Attributes: 4
> long_name : time
> units : days since 0001-01-01 00:00:00
> calendar : noleap
> bounds : time_bnds
>
>
> Variable: time3
> Type: double
> Total Size: 416 bytes
> 52 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 52]
> Coordinates:
> time: [36166.66666666666..54833.33333333334]
> Number Of Attributes: 4
> bounds : time_bnds
> calendar : noleap
> units : days since 0001-01-01 00:00:00
> long_name : time
>
>
> _______________________________________________
> 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 Sep 4 09:04:58 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 04 2013 - 10:27:56 MDT