Re: log axis using gsn_csm_contour

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 29 Sep 2008 13:28:10 -0600

Hi Jimmy,

Please see our FAQ question on this:

http://www.ncl.ucar.edu/FAQ/#vis_020

I think setting trY/XLog to True should work (and don't
set the trAxisType resources), but if this doesn't, try the
gsnYAxisIrregular2Log resource that's mentioned.

--Mary

On Sep 29, 2008, at 9:53 AM, James Correia wrote:

> Hi all-
> I am trying to construct my plot to be a log-log plot. I tried
> setting the log axis options for gsn_csm_contour but it did not ork
> presumably because I have not specified the axis to have the values
> I am labeling. Rather the axis is defined in terms of grid points.
> Is there a way to modify this?
> Thanks
> jimmyc
>
> Here is the code I am using:
> wmin = 10.
> wmax = 10000.
> wcint= 100.
>
> rmin = 0.
> rmax = 46.
> rcint= 2.
>
> flag = 1. ; 1:log of occurences or 0:just number of occurences
> nn = doubletointeger(((wmax-wmin)/wcint)+1)
> mm = doubletointeger(((rmax-rmin)/rcint)+1)
>
> if(flag .eq. 1)then
> result = log(result+1.)
> end if
>
>
> levels = fspan(wmin+wcint/2.,wmax+(wcint/2.)-wcint,6)
> level = fspan(rmin+(rcint/2.),rmax+(rcint/2.)-rcint,3)
> aaxis = fspan(0,nn-1,6)
> baxis = fspan(0,mm-1,3)
>
> ;set up mapping resources
> wks = gsn_open_wks("ps", "tsdiag")
> res = True
> res_at_cnLinesOn = True
> res_at_cnLineLabelsOn = True
> res_at_cnLevelSpacingF = .75 ;set lower if you want more levels
> res_at_cnMaxLevelCount = 10
> res_at_gsnDraw = True
> res_at_cnFillOn = True
> res_at_gsnSpreadColors = True
> res_at_gsnMaximize = True
> colors =
> (/"white","black","white","blue","pink","Green","Yellow","Orange","Red
> ","purple","Violet","brown"/)
> gsn_define_colormap(wks,colors)
>
> ; res_at_trXLog = True
> ; res_at_trYLog = True
> res_at_trXAxisType = "LogAxis"
> res_at_trYAxisType = "LogAxis"
> res_at_tmXBMode = "Explicit"
> res_at_tmXBValues = aaxis
> res_at_tmXBLabels = levels
> res_at_tmYLMode = "Explicit"
> res_at_tmYLValues = baxis
> res_at_tmYLLabels = level
>
> plot = gsn_csm_contour(wks,result,res)
>
>
> --
> James Correia Jr.
> Post Doc
> Climate Physics Group, PNNL
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 29 2008 - 13:28:10 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 29 2008 - 13:35:43 MDT