[Thread Prev][Thread Next][Index]

Re: how to change the symbol size?



Hi again Kun,
	In the earlier answer I mentioned that using plot marks may be
a bit limiting from the point of view of the shape of the arrow.  Also
one cannot rely on the length of the symbol being equal to the "height"
value entered in the label command.
	Here is a way to customize the arrow by defining in inches and
degrees its characteristics and using the "ppl aline/nouser" command.
The same idea could be applied in user units if one were to take care
of the aspect ratio issue.

STEP 1:  Edit in the following .jnl file
!
! plotarrow.jnl   (1/11/2001 mick spillane noaa/pmel)
!
! plots an arrow with head at (xhead,yhead) and pointing
! toward arrowdir (degrees clockwise from north).  the arrow
! has length shaftlength and barblength in inches, and the 
! barbs make an angle barbangle degrees with the shaft, the
! arrow color is arrowcolor (0-19)
!
        ppl pen,1,`arrowcolor`
        let deg2rad = atan(1.)/45
        let radang  = deg2rad * (90 - arrowdir) 
        let xend = xhead - shaftlength * cos(radang)
        let yend = yhead - shaftlength * sin(radang)
        ppl aline/nouser,1,`xhead`,`yhead`,`xend`,`yend`
        let radang  = deg2rad * (90 - arrowdir - barbangle)  
        let xend = xhead - barblength * cos(radang) 
        let yend = yhead - barblength * sin(radang) 
        ppl aline/nouser,1,`xhead`,`yhead`,`xend`,`yend` 
        let radang  = deg2rad * (90 - arrowdir + barbangle)   
        let xend = xhead - barblength * cos(radang) 
        let yend = yhead - barblength * sin(radang) 
        ppl aline/nouser,1,`xhead`,`yhead`,`xend`,`yend`
        ppl pen,1,1 

STEP 2: Use it as in the following demo

plot/i=1:10 1/i

let arrowcolor= 14
let shaftlength=2 ; let barblength=0.3 ; let barbangle=30 
let xhead=6 ; let yhead=3 ; let arrowdir=135 ; go plotarrow

let arrowcolor= 16 
let shaftlength=1 ; let barblength=0.2 ; let barbangle=15
let xhead=3 ; let yhead=3 ; let arrowdir=240 ; go plotarrow

-----------------------------------------------------------------
Other ideas for even fancier arrows come from the POLYGON
discussion in the user guide.  For example try this

let xp=180+30*randu(i[i=1:10]) ; let yp=30*randu(1+i[i=1:10])
let xt=ysequence({0,2,2,10,9,10,2,2})
let yt=ysequence({0,3,1,2,0,-2,-1,-3})
polygon xt+xp,yt+yp,i[i=1:10]

Happy Archery,
Mick

|--****--****-*---*---***--***--|____spillane@pmel.noaa.gov____|
|-*__---*-----*--*-*--*--*-*--*-|_SCIENCE APPLICATIONS SUPPORT_|
|--***--*-----*-*---*-***--***--|____EPIC/Ferret/PlotPlus______|
|-----*-*-----*-*****-*----*----|__Room 2070 Bldg#3 NOAA/PMEL__|
|-****---****-*-*---*-*----*----|____Phone_:_(206)526-6780_____|



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement