1 | function plotsym, circle=circle, triangle=triangle, diamond=diamond, $ |
---|
2 | angle=angle, box=box, line=line, scale=scale, $ |
---|
3 | _extra=extra |
---|
4 | ;+ |
---|
5 | ; NAME: |
---|
6 | ; plotsym |
---|
7 | ; PURPOSE: |
---|
8 | ; function to make plotting symbols much easier. |
---|
9 | ; Usage: |
---|
10 | ; plot,x,y,psym=plotsym(/circle,scale=2,/fill) |
---|
11 | ; |
---|
12 | ; CATEGORY: |
---|
13 | ; Graphics. |
---|
14 | ; |
---|
15 | ; Keywords: |
---|
16 | ; circle = circle symbol |
---|
17 | ; triangle = triangle symbol |
---|
18 | ; diamond = diamond symbold |
---|
19 | ; box = box symbol |
---|
20 | ; line = line symbol |
---|
21 | ; scale = scales the symbol |
---|
22 | ; angle = angle the symbol should be rotated |
---|
23 | ; _extra = extra keywords for usersym. These are thick, color and fill |
---|
24 | ; |
---|
25 | ; Written by: |
---|
26 | ; Ronn Kling |
---|
27 | ; Ronn Kling Consulting |
---|
28 | ; 7038 Westmoreland Dr. |
---|
29 | ; Warrenton, VA 20187 |
---|
30 | ; klingrl@juno.com |
---|
31 | ; copyright 1999, all rights reserved |
---|
32 | ;- |
---|
33 | |
---|
34 | if not keyword_set(scale) then scale=1.0 |
---|
35 | if not keyword_set(angle) then angle=0.0 |
---|
36 | |
---|
37 | if keyword_set(circle) then begin |
---|
38 | theta = findgen(30)/29.*360. |
---|
39 | endif else if keyword_set(triangle) then begin |
---|
40 | theta = [-30.,90.,210., -30.] |
---|
41 | endif else if keyword_set(diamond) then begin |
---|
42 | theta = [0.,90.,180.,270.,0.] |
---|
43 | endif else if keyword_set(box) then begin |
---|
44 | theta = [315.,45.,135.,225.,315.] |
---|
45 | endif else if keyword_set(line) then begin |
---|
46 | theta = [-180.,0.] |
---|
47 | endif |
---|
48 | |
---|
49 | theta = theta + angle |
---|
50 | x = cos(theta * !dtor) * scale |
---|
51 | y = sin(theta * !dtor) * scale |
---|
52 | |
---|
53 | usersym, x,y, _extra=extra |
---|
54 | return,8 |
---|
55 | end |
---|