Re: How to control the y-axis when using gsn_csm_xy?

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 01 2010 - 16:30:03 MST

Hi Hongli,
I think the resources that you want are trYMinF and trYMaxF:
http://www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trYMinF
http://www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trYMaxF
Take a look at the tickmark examples here:
http://www.ncl.ucar.edu/Applications/tickmarks.shtml
Specifically, see example #1.
Hope that helps...
Adam

On 03/01/2010 04:22 PM, hongli wang wrote:
> All,
>
>
> I want to control the value of Y-axis to range 0. to 0.5. I add two lines:
>
> res@tiYMin = 0.0
>
> res@tiYMaxF = 0.5
>
> But it doesn't work:
>
>
> warning:tiYMin is not a valid resource in pdf_xy at this time
>
> warning:tiYMaxF is not a valid resource in pdf_xy at this time
>
>
> Thank for any suggestions or solutions!
>
>
> Hongli
>
> -------------------------
>
> http://www.ncl.ucar.edu/Applications/Scripts/pdf_1.ncl
>
>
> begin
>
> a = random_normal (0,50, (/64,128/))
>
> b = random_chi (2 , (/1000/))
>
> c = random_gamma (75,2, (/50,100/))
>
>
> ap = pdfx(a, 0, False) ; default number of bins
>
> bp = pdfx(b, 0, False)
>
> cp = pdfx(c, 0, False)
>
>
> ;------------------------------------------------
>
> ; Plot each PDF
>
> ;------------------------------------------------
>
> nVar = 3
>
> plot = new ( nVar, "graphic")
>
>
> wks = gsn_open_wks ("x11","pdf")
>
>
> res = True
>
> res@gsnDraw = False
>
> res@gsnFrame = False
>
> res@xyLineThicknessF = 2
>
> res@tiYAxisString = "PDF (%)"
>
> res@tiYMin = 0.0
>
> res@tiYMaxF = 0.5
>
>
> res@gsnCenterString = "Univariate PDF: Normal"
>
> plot(0) = gsn_csm_xy (wks, ap@bin_center, ap, res)
>
> res@gsnCenterString = "Univariate PDF: Chi (df=2)"
>
> plot(1) = gsn_csm_xy (wks, bp@bin_center, bp, res)
>
> res@gsnCenterString = "Univariate PDF: Gamma (75,2)"
>
> plot(2) = gsn_csm_xy (wks, cp@bin_center, cp, res)
>
>
> resP = True
>
> resP@txString = "Univariate PDFs of Three Variables"
>
> resP@gsnPanelRowSpec = True ; tell panel what order
> to plt
>
> gsn_panel(wks,plot,(/1,2/),resP)
>
> end
>
>
>
>
> _______________________________________________
> 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
Received on Mon Mar 1 16:30:09 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 04 2010 - 15:07:06 MST