[ncl-talk] top x-axis label

yang yang yang.yang816 at gmail.com
Thu Apr 15 15:03:12 MDT 2021


Hi Adam:

Thanks very much for your help!

Ed

On Fri, Apr 16, 2021 at 4:27 AM Adam Phillips <asphilli at ucar.edu> wrote:

> Hi Ed,
> Thank you for including an easy-to-follow script that shows your complete
> resource list. To set the top tick marks differently than the bottom tick
> marks, you need to set res at tmXUseBottom
> <http://www.ncl.ucar.edu/Document/Graphics/Resources/tm.shtml#tmXUseBottom>
> = False.
> Note that the arrays passed to tmXBValues/tmXTValues need to be within the
> range of your specified trXMinF/trXMaxF settings. (Your settings are indeed
> within this range.)
> Adam
>
>
> On Wed, Apr 14, 2021 at 7:24 PM yang yang via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Dear Sir/Madam:
>>
>> I would like to label the bottom and top x-axis, which are different.
>> For the top-axis, I set:
>>      res at tmXTMode          = "Explicit"
>>      res at tmXTValues        =
>> (/log10(2*3.14/1000000.),log10(2*3.14/500000.),log10(2*3.14/250000.),log10(2*3.14/100000.),log10(2*3.14/50000.)/)
>>      res at tmXTLabels = (/"1000","500","250","100","50"/)
>>
>> For the bottom-axis, I set:
>>      res at tmXBMode          = "Explicit"         ; explicit labels
>>      res at tmXBValues        = (/-6,-5,-4,-3/)
>>      res at tmXBLabels =
>> (/"10~S~-6~N~","10~S~-5~N~","10~S~-4~N~","10~S~-3~N~"/)
>>
>> The label of the bottom axis can show as I want successfully. However,
>> the top-axis does not show anything. I have checked codes and could not
>> find any problems. Can you please sort this out for me? The plotting
>> parameters are shown below.
>> Thanks very much!
>> Regards
>> Ed
>>
>> ;************************************************
>> ; plotting parameters
>> ;************************************************
>> wks_type = "png"
>> wks_type at wkWidth = 1200
>> wks_type at wkHeight = 1200
>>
>>  wks   = gsn_open_wks (wks_type,"ke-spectra")                 ; open
>> workstation
>>
>>   res          = True                   ; plot mods desired
>>   res at gsnFrame = False                  ; don't advance frame yet
>>
>>    res at xyLineThicknesses = (/2,2,2,2,2/)               ; make lines
>> thicker
>>    res at xyDashPatterns    = (/0,0,0,0,0/)      ; make all lines solid
>>
>>    res at xyLineColors      = (/"black","blue","green","red","yellow"/)
>>      ; change line color
>>
>> res at xyMarkLineMode = "MarkLines"
>>  res at xyMarkers      = (/0,0,0,0,0/)
>>  res at xyMarkerColors = (/"black","blue","green","red","yellow"/) ;
>>  different colors`
>>   res at vpHeightF= 0.4                    ; change aspect ratio of plot
>>   res at vpWidthF = 0.6
>>   res at trYMinF  = 3.8                   ; min value on y-axis
>>   res at trYMaxF  = 6.5                  ; max value on y-axis
>>  res at trXMinF  = -6.                   ; min value on x-axis
>>   res at trXMaxF  = -3.
>>
>>      res at tmXTMode          = "Explicit"
>>      res at tmXTValues        =
>> (/log10(2*3.14/1000000.),log10(2*3.14/500000.),log10(2*3.14/250000.),log10(2*3.14/100000.),log10(2*3.14/50000.)/)
>>      res at tmXTLabels = (/"1000","500","250","100","50"/)
>>
>>      res at tmXBMode          = "Explicit"         ; explicit labels
>>      res at tmXBValues        = (/-6,-5,-4,-3/)
>>      res at tmXBLabels =
>> (/"10~S~-6~N~","10~S~-5~N~","10~S~-4~N~","10~S~-3~N~"/)
>>
>>      res at tmYLMode          = "Explicit"
>>      res at tmYLValues        = (/4.,5.,6./)
>>      res at tmYLLabels = (/"10~S~4~N~","10~S~5~N~","10~S~6~N~"/)
>>      res at tmXBLabelFontHeightF = 0.0205
>>      res at tmXTLabelFontHeightF = 0.0205
>>      res at tmYLLabelFontHeightF = 0.0225
>>      res at tmYLLabelFont = "helvetica"
>>      res at tmXBLabelFont = "helvetica"
>>      res at tmXTLabelFont = "helvetica"
>>   res at vpXF     = 0.2                  ; start plot at x ndc coord
>>
>>   res at tiYAxisString = "KE(kg m~S~-3~N~ m~S~2~N~ s~S~-2~N~)"  ; axis
>> string
>>
>>   res at tiXAxisString = "k (radians m~S~-1~N~)"  ; axis string
>>
>>   res at tiMainString     = "11-16 km layer" ; title
>>
>> plot = gsn_csm_xy(wks,kf,log10(tke),res)
>>
>> end
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at mailman.ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210416/40fdd103/attachment.html>


More information about the ncl-talk mailing list