source: trunk/SRC/ToBeReviewed/PLOTS/plotsym.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

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