I want it draw Right Yaxis tickmarks without lables or tittles, but what I did was not willing to make it work.

From: lxf <heaven_bird334_at_nyahnyahspammersnyahnyah>
Date: Wed, 10 Jan 2007 13:34:01 +0800

Hi,
   I have a little problem about tickmark and labels. I plot two lines in one figure using "gsn_csm_x2y2".
Because of the y axis is the same, I want it draw Right Yaxis tickmarks without lables or tittles.
So, I use :
    res1_at_tiYAxisString = ""
    res1_at_tmYRMode = "Automatic"
    res1_at_tmYUseLeft = False
    res1_at_tmYROn = True
    res1_at_tmYRLabelsOn = False

    res2_at_tiYAxisString = ""
    res2_at_tmYRMode = "Automatic"
    res2_at_tmYUseLeft = False
    res2_at_tmYROn = True
    res2_at_tmYRLabelsOn = False
   But,it does not work. Is there anybody can help me?
   The picture is too big to attached behind .And I think the complete code maybe helpful to find out the problem.
;================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
    fi = "response.hb.grd"
    n = 20000
    nrec = 0
    dims = (/n/)
    t0 = 5
    t1 = 10
    trx0 = 0
    trx1 = 0.6
    try0 = -0.1
    try1 = 1.1
    
    hb = fbindirread (fi,0,dims,"float")
    hl = fbindirread (fi,1,dims,"float")
    xhb = fbindirread (fi,2,dims,"float")
    xhl = fbindirread (fi,3,dims,"float")
;========================
    data = new((/2,dimsizes(hb)/),float)
    xaxis = new((/2,dimsizes(xhb)/),float)
    data(0,:) = hb(:)
    data(1,:) = hl(:)
    xaxis(0,:) = xhb(:)
    xaxis(1,:) = xhl(:)

; Set line colors and dash patterns for both curves.
;
    line_col2 = "red"
    line_col1 = "blue"
    line_pat2 = 0 ; Solid
    line_pat1 = 2 ; Dashed
    m1 = "Butterworth(5~10days)" ;legend lable
    m2 = "Lanczos(5~10days)"
    
   ; wks = gsn_open_wks("X11","x2y2") ; Open "xy.ps"
    wks = gsn_open_wks ("eps","5-10") ; Open "xy.ps"

    res1 = True
    res1_at_gsnFrame = False
    res1_at_gsnMaximize = True ; Maximize plot in frame.
    
    res1_at_xyLineColor = line_col1
    res1_at_xyDashPattern = line_pat1
    res1_at_xyLineThicknesses = 3 ; line thicker
    
    
    res1_at_tiYAxisString = ""
    res1_at_tmYRMode = "Automatic"
    res1_at_tmYUseLeft = False
    res1_at_tmYROn = True ; Don't draw labels for
    res1_at_tmYRLabelsOn = False ; right Y axes, b/c left
    res1_at_tmXBLabelFontColor = line_col1 ; and right axes are same.
    
    res1_at_trXMinF = trx0
    res1_at_trXMaxF = trx1
    res1_at_trYMinF = try0
    res1_at_trYMaxF = try1
    
    res1_at_tiXAxisString = "Frequency"
    res1_at_tiYAxisString = "Response"
  ; res1_at_gsnCenterString = "days"
    
    res2 = True
    res2_at_gsnFrame = False
    res2_at_gsnMaximize = True ; Maximize plot in frame.
    
    res2_at_xyLineColor = line_col2
    res2_at_xyDashPattern = line_pat2
    res2_at_xyLineThicknesses = 2 ; line thicker
    
    res2_at_tiYAxisString = ""
    res2_at_tmYRMode = "Automatic"
    res2_at_tmYUseLeft = False
    res2_at_tmYROn = True ; Don't draw labels for
    res2_at_tmYRLabelsOn = False ; right Y axes, b/c left
    res2_at_tmXTLabelFontColor = line_col2 ; and right axes are same.
    
    res2_at_trXMinF = res1_at_trXMinF
    res2_at_trXMaxF = res1_at_trXMaxF
    res2_at_trYMinF = res1_at_trYMinF
    res2_at_trYMaxF = res1_at_trYMaxF
    
    res2_at_tmXUseBottom = False ; Keep top axis independent of bottom.
    res2_at_tmXTLabelsOn = True ; have tick mark labels
    res2_at_tmXTOn = True ; have tick marks
    res2_at_tmXBBorderOn = False
    res2_at_tmXTMode = "Explicit" ; label independently
    res2_at_tmXTValues = (/ 1./t0,1./t1 /)
    res2_at_tmXTLabels = (/ t0,t1/)
;
; Here's the call to draw two curves, each with their own set of
; axes. This example is a little unusual, because we went through
; the trouble of making both Y axes the same.
;
    plot = gsn_csm_x2y2(wks,xaxis(0,:),xaxis(1,:),data(0,:),data(1,:),res1,res2)
;==============================================
; Draw some text and lines to create a legend.
;
    res_text = True
    res_text_at_txFontHeightF = 0.015
    res_text_at_txJust = "CenterLeft"

    res_lines = True ; polyline mods desired
    res_lines_at_gsLineColor = line_col1 ; line color
    res_lines_at_gsLineThicknessF = 2 ; line thicker
    res_lines_at_gsLineDashPattern = line_pat1 ; dash pattern

    xx = (/0.35,0.40/)
    yy = (/.95,.95/)
    gsn_polyline(wks,plot,xx,yy,res_lines)
    gsn_text(wks,plot,m1,0.41,.95,res_text)

    yy = (/0.90,0.90/)
    res_lines_at_gsLineColor = line_col2 ; line color
    res_lines_at_gsLineDashPattern = line_pat2 ; dash pattern
    gsn_polyline(wks,plot,xx,yy,res_lines)
    gsn_text(wks,plot,m2,0.41,0.90,res_text)
;=============================================
; Draw some lines
;
    res_lines = True ; polyline mods desired
    res_lines_at_gsLineColor = 1 ; line color
    res_lines_at_gsLineThicknessF = 1 ; line thicker
    res_lines_at_gsLineDashPattern = 0 ; dash pattern

    xx = (/ 1./t1,1./t1 /)
    yy = (/ try0,try1 /)
    gsn_polyline(wks,plot,xx,yy,res_lines)
    xx = (/ 1./t0,1./t0 /)
    yy = (/ try0,try1 /)
    gsn_polyline(wks,plot,xx,yy,res_lines)
    xx = (/ trx0,trx1 /)
    yy = (/ 0,0 /)
    gsn_polyline(wks,plot,xx,yy,res_lines)
    yy = (/ 1,1 /)
    gsn_polyline(wks,plot,xx,yy,res_lines)
    
    frame(wks)
end

                                 
Li
2007-01-10

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 09 2007 - 22:34:01 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 11 2007 - 10:16:54 MST