Re: tickmark help with bar chart

From: Erik Noble <nobleeu_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 14 2011 - 13:36:39 MDT

Hi Rick and Alex. first,
The tmXBMode = "Explicit" function worked and the plot did what I
needed it to do. Thank you.
I was more curious whether it was necessary to be always use
"explicit" in this case.
Erik

On Thu, Apr 14, 2011 at 1:01 PM, Adam Phillips <asphilli@ucar.edu> wrote:
> Hi Erik,
> I would expect the following to work:
> sres@tmXBMode          = "Explicit"
> sres@tmXBValues        = ispan(1,32,1)
> sres@tmXBLabels = "E"+sres@tmXBValues
>
> In this case you will need to set tmXBMode = "Explicit", as you want
> customized XB labeling and you want major tick marks at every instance
> of your x-array. Let us know if the above doesn't help.. Adam
>
> On 04/13/2011 09:40 PM, Erik Noble wrote:
>> (I'm not sure if this was sent the first time b/c I received a
>> bounceback message but if it did, I apologize ahead of time.)
>>
>> Hello,
>> I made a script similar to example 9 here
>> http://www.ncl.ucar.edu/Applications/bar.shtml
>> I was successful but I'm having trouble getting the tickmarks right.
>> The picture shows that my a-axis tickmarks are doing some default that
>> I don't understand. I'm only plotting 32 point; just want the labels
>> to say 1 through 32.
>> I have tried all three of the @tmXBMode options.
>> There should be a way to this without having to use the using the
>> "explicit" option, right? Its just 32 points.
>> Below is my snippit of plotting code.
>>
>> Any help would be appreciated.
>> Sincerely,
>> Erik
>>
>>
>> ;***********************************************
>> ;Create bar chart
>> ;***********************************************
>>      wks = gsn_open_wks("eps","unique")
>>      newcolor = NhlNewColor(wks,.6,.85,1.)
>>      newcolor = NhlNewColor(wks,0.42,0.42,0.42)
>>
>>      sres = True
>>      sres@vpWidthF = 0.7
>>      sres@vpHeightF = 0.5
>>      sres@vpXF = .15
>>      sres@trXMinF = 0.4
>>      sres@trXMaxF = 32.6
>>      sres@trYMinF = 0.75
>>      sres@trYMaxF = 2.50
>>      sres@gsnDraw = True
>>      sres@gsnFrame = False
>>      sres@gsnXYBarChart = True
>>      sres@gsnXYBarChartBarWidth = 0.20           ; change bar widths
>>      sres@tmXBMode          = "Manual"
>>      sres@tmXBTickStartF    = 1
>>      sres@tmXBTickEndF = 32
>>      ; sres@tmXBTickSpacingF = 1
>>      ; sres@tmXBMode          = "Explicit"         ; explicit labels
>>      ; sres@tmXBValues        =
>> (/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32/)
>>      ; sres@tmXBLabels =
>> (/"E1","E2","E3","E4","E5","E6","E7","E8","E9","E10","E11","E12","E13","E14","E15","E16","E17","E18","E19","E20","E21","E22","E23","E24","E25","E26","E27","E28","E29","E30","E31","E32"/)
>>      sres@tmXBLabelFontHeightF = 0.0205
>>      sres@tmXTLabelFontHeightF = 0.0205
>>      sres@tmYLLabelFontHeightF = 0.0225
>>      sres@tiMainFontHeightF = 0.025
>>      sres@tiMainFont = "helvetica"
>>      sres@tiMainString = " Ratio of Total Accumulated Precipitation"
>>      sres@gsnCenterString = "5~S~o~N~N-15~S~o~N~N, 30~S~o~N~W 10~S~o~N~E"
>>      sres@gsnRightString = ""
>>      sres@tiYAxisString = "Ratio" ;"(~S~o~N~C)"
>>
>>      sres@gsnXYBarChartColors = (/"red"/)
>>      plot1 = gsn_csm_xy(wks,fspan(.775,31.775,32),ratio(:,0),sres)              ;
>> draw each timeseries
>>      sres@gsnXYBarChartColors = (/"lightblue"/)
>>          ; seperately, not
>>      plot2 = gsn_csm_xy(wks,fspan(.925,31.925,32),ratio(:,1),sres)              ;
>> advancing the frame
>>      sres@gsnXYBarChartColors = (/"blue"/)
>>          ; but tweaking where
>>      plot3 = gsn_csm_xy(wks,fspan(1.075,32.075,32),ratio(:,2),sres)             ;
>> each timeseries is
>>
>>          ; drawn on the X-axis
>>
>>      frame(wks)
>> end
>>
>>
>>
>> --
>> _______________________________________________________
>> Erik Noble
>> Center for Climate Systems Research, Columbia University
>> NASA Goddard Institute for Space Studies
>> 2880 Broadway, New York, NY-10025, USA
>>
>> Tel: +1 (212) 678-5664; Fax: +1 (212) 678-5552
>> E-mail: enoble@giss.nasa.gov, en2192@columbia.edu
>> WEB:  http://www.giss.nasa.gov/staff/enoble.html
>> GISS: http://www.giss.nasa.gov
>> CCSR: http://www.ccsr.columbia.edu
>> _______________________________________________________
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> __________________________________________________
> Adam Phillips
> asphilli@ucar.edu
> National Center for Atmospheric Research   tel: (303) 497-1726
> Climate and Global Dynamics Division         fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> 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 Fri Apr 15 05:38:00 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2011 - 18:32:03 MDT