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

Vennam, Lakshmi Pradeepa lakshmi at live.unc.edu
Tue Mar 15 19:23:58 MDT 2016


Thank you Adam for the suggestion. Appreciate it.

Yes, figured out the issue yesterday and already made that change. Everything works fine now.

Regards,
Pradeepa.
________________________________
From: Adam Phillips <asphilli at ucar.edu>
Sent: Tuesday, March 15, 2016 3:16 PM
To: Vennam, Lakshmi Pradeepa
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] Unable to get right Y-axis labels in the plot

Hi Pradeepa,
Your tmYRValues need to fall within the tmYL range for them to show up. For instance, I bet if you change this:
res at tmYRValues = (/640.00,2200.00,4200.00,6700.00,8000.00,12500.00,14100.00/)
to this:
res at tmYRValues = fspan(270,420,7)

the labels will show up. Thus, I think you will need to map your desired right hand side Y-axis values up to your values on the left hand side Y-axis.

Hope that helps. If not, or if you have any further questions, please respond to the ncl-talk email list and not to me personally.
Adam


On Sun, Mar 13, 2016 at 5:54 PM, Vennam, Lakshmi Pradeepa <lakshmi at live.unc.edu<mailto:lakshmi at live.unc.edu>> wrote:

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

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk




--
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/<http://www.cgd.ucar.edu/staff/asphilli/>   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160316/5f2505b7/attachment.html 


More information about the ncl-talk mailing list