[ncl-talk] Unable to get right Y-axis labels in the plot

Vennam, Lakshmi Pradeepa lakshmi at live.unc.edu
Sun Mar 13 17:54:39 MDT 2016


Hello all,


Few weeks back I posted to ncl-talk that I wasn't able to get right side Yaxis labels in some of the plots that I am trying to do.


So I tested right Yaxis labels function (tmYRLabels) with a simple sample script.  I am attaching my sample script, figure and log file here.


When I printed the YRLabels variable summary it shows the explicit labels that I provided (look at the log file) but for some reason they are not plotted in the figure. Can someone please let me know if I am missing anything in my sample script. Appreciate any kind of help.


I am also pasting my code below for a quick glance.


Thanks,

Pradeepa.


Code:


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"


begin


 wks = gsn_open_wks("pdf","test9yRlabel")

 gsn_define_colormap(wks,"gui_default")        ; choose colormap

 plot1 = new(1, graphic)


 YL = (/280,300,320,340,360,380,400,420,440/)

 X = (/10,15,20,25,30,35,40,45,50/)


 res = True

 res at tmYROn     = True              ; turn on the YR tickmarks

 res at tmYRLabelsOn = True              ; turn the YR labels on

 res at tmYUseLeft = False

 res at tmYRMode = "Explicit"  ; explicitly set Y-axis labels

 res at tmYRValues = (/640.00,2200.00,4200.00,6700.00,8000.00,12500.00,14100.00/)

 res at tmYRLabels = (/"640","2200", "4200", "6700", "8000", "12500", "14100"/)


 plot1 = gsn_csm_xy(wks,X,YL,res)


  getvalues plot1                         ; retrieve some of the plot resources

     "tmYLLabels"  : tmYLLabels          ; values used by NCL at major tick marks

  end getvalues

   getvalues plot1                         ; retrieve some of the plot resources

     "tmYRLabels"  : tmYRLabels          ; values used by NCL at major tick marks

  end getvalues



 printVarSummary(tmYLLabels)

 print(tmYLLabels)

 printVarSummary(tmYRLabels)

 print(tmYRLabels)


frame(wks)

delete(res)


end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160313/719e5d32/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_yRlabel1.log
Type: application/octet-stream
Size: 4812 bytes
Desc: test_yRlabel1.log
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160313/719e5d32/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_yRlabels.ncl
Type: application/octet-stream
Size: 1237 bytes
Desc: test_yRlabels.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160313/719e5d32/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test9yRlabel.pdf
Type: application/pdf
Size: 18986 bytes
Desc: test9yRlabel.pdf
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160313/719e5d32/attachment.pdf 


More information about the ncl-talk mailing list