; ; File: testXTLabels.ncl ; ; Author: D. Adriaansen ; ; Date: 29 Mar 2017 ; ; Purpose: Demonstrate labeling the top X-axis on an X-Y plot ; ; Notes: NCL Version 6.3.0 AND 6.4.0, ; Linux cessna 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux ;________________________________________________________________________ ; Generate some sample x-data xdata = ispan(0,99,1) ; Generate some sample y-data ydata = fspan(0,1.0,100) ; Open a workstation wks = gsn_open_wks("png","testXTLabels") ; Set up plot resources res = True ; GSN resources res@gsnFrame = False res@gsnDraw = False ; Tickmark resources res@tmXUseBottom = False ; Tell NCL we don't want to use the bottom axis for both X axes res@tmXTOn = True ; Turn on the top X-axis tickmarks res@tmXTMode = "Explicit" ; Explicitly position and label the top X-axis tickmarks res@tmXTValues = (/0,25,50,75,99/) ; Values for where to put the tickmarks res@tmXTLabels = (/"0","25","50","75","99"/) ; Corresponding strings to use for labels of the top X-axis tickmarks res@tmXBOn = False ; Turn off the bottom X-axis tickmarks to see if it has any effect ; Plot plot = gsn_csm_xy(wks,xdata,ydata,res) draw(plot) frame(wks)