Re: Labels on X axes

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 19 Sep 2008 09:24:40 -0600

Hi Marco,

Take a look at example 6 here:
http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex6

It shows how to display 2 different y-axis, although it doesn't show how
to explicitly set the right hand y-axis.

You will need to set the tmXUseBottom = False
http://www.ncl.ucar.edu/Document/Graphics/Resources/tm.shtml#tmXUseBottom

You will also need to set tmXTMode = "Explicit", tmXTValues, tmXTLabels,
and also set tmXTLabelsOn = True. Note that the XTValues will need to be
in terms of the XBValues. In other words, if your bottom x-axis runs
from 1-100, the the XTValues need to be in the range of 1-100 as well.
(The XTLabels can be whatever you want though.)

Hope that helps,
Adam

Marco Pastore wrote:
> Hi all.
>
> Is it possible to display a different set of Labels on the two x-labels
> in ncl plots ?
>
> I tried, but the results is no labels or the same labels in both x-axes.
>
> My script:
>
> wks = gsn_open_wks("ps","trans") ; open a ps file
> gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
>
> res = True ; plot mods desired
> res_at_tmXBMode = "Explicit" ; explicitly label x-axis
> res_at_tmXTMode = "Explicit" ; explicitly label x-axis
> res_at_tmYLMode = "Explicit" ; explicitly label y-axis
> res_at_tmXTLabelsOn = True
>
>
> res_at_gsnFrame = False ; don't turn page yet
> res_at_gsnDraw = False ; don't draw yet
>
> res_at_tmXTValues = (/0,1/) ; points to label
> res_at_tmXTLabels = (/leftlat+"N ~C~"+leftlon+"E",rightlat+"N
> ~C~"+rightlon+"E"/)
> res_at_tmXBValues = (/points(0),points(npt-1)/) ; points to label
> res_at_tmXBLabels = (/0,ceil(dist/1000)/)
> res_at_tmYLValues = zdpth
> res_at_tmYLLabels = ""+zdpth
>
> res_at_cnFillOn = True ; turn on color
> res_at_cnMissingValFillPattern = 0 ; these two resource to plot
> missing values in black
> res_at_cnMissingValFillColor = "black" ;
> res_at_lbLabelAutoStride = True ; nice label bar label stride
> res_at_gsnSpreadColors = True ; use full range of colormap
> res_at_cnLinesOn = False ; turn off countour lines
> res_at_lbOrientation = "Horizontal" ; Horizontal label bar
> res_at_pmLabelBarOrthogonalPosF = -0.05 ; move label bar closer to
> plot
>
> res_at_tiMainString = "Transect" ; add title
>
> res_at_trYReverse = False ; don't reverse y axis
> res_at_gsnYAxisIrregular2Linear = True
> res_at_vpHeightF = 0.4
> res_at_vpWidthF = 0.8
> res_at_vpXF = 0.10
> res_at_lbBoxMajorExtentF = 1 ; relative dimension of the boxes
> res_at_lbBoxMinorExtentF = 0.2
> res_at_tmYROn = False
> ;res_at_tmXTOn = False
> res_at_tmYLMinorOn = False
> res_at_tmYLLabelStride = 4
> res_at_tmXBMajorLengthF = 0.002
> res_at_tmYLMajorLengthF = 0.002
> res_at_tmXBMinorLengthF = 0.001
> res_at_tmYLMinorLengthF = 0.001
> res_at_tmXTMajorLengthF = 0.002
> res_at_tmYRMajorLengthF = 0.002
> res_at_tmXTMinorLengthF = 0.001
> res_at_tmYRMinorLengthF = 0.001
>
> res_at_tmXBLabelFontHeightF = 0.016
> res_at_tmYLLabelFontHeightF = 0.016
> res_at_lbLabelFontHeightF = 0.016
> res_at_cnLevelSpacingF = 0.15 ; set contour spacing
>
> plot = gsn_csm_contour(wks,temp(zlev|:,point|:),res) ; create plot
>
>
> Result:
>
>
>
> If i invert the array assignment between XTLabels and XBLabels, labels
> changes, but however both axes have the same labels.
>
> Could you help me ?
>
> Thanks, Marco
>
> --
> ### ### ### ### ###
>
> MARCO PASTORE
>
> Istituto Nazionale di Geofisica e Vulcanologia
> Gruppo Nazionale di Oceanografia Operativa
> Viale Aldo Moro 44
> 40128, Bologna
>
> Tel:(+39)051-3782649
> Cel:(+39)339 8273965
>
> Skype: mapas71
>
>
> ### ### ### ### ###
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 19 2008 - 09:24:40 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 23 2008 - 14:12:01 MDT