Re: how to change Y/X axis border line color in xyplot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 09 Apr 2009 10:48:21 -0600

Hi Guangshan,

You responded previously that you wanted to color one axis one color,
and then another axis another color, and thus tmBorderLineColor won't
work for this.

There is a work around to get what you want though, by selectively
drawing individual axis while drawing the xy-plot multiple times. This
is best illustrated by an example script/image. (attached)

You can go a step farther and color the tickmark labels the same color
as the respective axis.
Hope this helps.
Adam

Adam Phillips wrote:
> Hi Guangshan,
> I think tmBorderLineColor will do what you want:
> http://www.ncl.ucar.edu/Document/Graphics/Resources/tm.shtml#tmBorderLineColor
>
> You might want to set other resources as well, such as
> tmXBMajorLineColor / tmXBMinorLineColor / tmYLMajorLineColor, etc...
> Adam
>
> guangshan chen wrote:
>> Dear all,
>>
>> Is there anyway to change Y/X axis border line color in xy plot?
>> Thanks advance.
>>
>> Guangshan
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli


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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
  data = random_uniform(-5,5.5,(/50/))
;-------------------------------------------
        wks = gsn_open_wks("ps","test")
  gsn_define_colormap(wks,"Rainbow")

  res = True
        res_at_vpWidthF = 0.7
        res_at_vpXF = 0.15
        res_at_vpHeightF = 0.35
        res_at_gsnFrame = False
        
        res_at_tmBorderLineColor = "green"
        res_at_tmYLMajorLineColor = "green"
        res_at_tmYLMinorLineColor = "green"
        res_at_tmXBOn = False
        res_at_tmXTOn = False
        res_at_tmYROn = False
        res_at_tmXBBorderOn = False
        res_at_tmYRBorderOn = False
        res_at_tmXTBorderOn = False
        
        plot = gsn_csm_xy(wks,ispan(1,50,1),data,res) ; draw YL axis green
        
        res_at_tmBorderLineColor = "black"
        res_at_tmYLMajorLineColor = "black" ; YR axis uses YL resources, can
        res_at_tmYLMinorLineColor = "black" ; change by setting tmYUseLeft = False
        res_at_tmYLOn = False
        res_at_tmYROn = True
        res_at_tmXTOn = True
        res_at_tmYLBorderOn = False
        res_at_tmYRBorderOn = True
        res_at_tmXTBorderOn = True
        plot2 = gsn_csm_xy(wks,ispan(1,50,1),data,res) ; draw XT/YR axis black (=default)
        
        res_at_tmBorderLineColor = "blue"
        res_at_tmXBMajorLineColor = "blue"
        res_at_tmXBMinorLineColor = "blue"
        res_at_tmYROn = False
        res_at_tmXTOn = False
        res_at_tmXBOn = True
        res_at_tmYRBorderOn = False
        res_at_tmXTBorderOn = False
        res_at_tmXBBorderOn = True
        plot3 = gsn_csm_xy(wks,ispan(1,50,1),data,res) ; draw XB axis blue
  frame(wks)
end
        
        

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

test.gif
Received on Thu Apr 09 2009 - 10:48:21 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 12 2009 - 14:28:35 MDT