Re: circle plot symbol [message #20184 is a reply to message #20150] |
Tue, 23 May 2000 00:00  |
ronn
Messages: 123 Registered: April 1999
|
Senior Member |
|
|
Refik,
Here is what I use for plotting special symbols. It is very
straightforward and is easy to extend to other symbols.
-Ronn
----------------------------------------------
function plotsym, circle=circle, triangle=triangle, diamond=diamond, $
angle=angle, box=box, line=line, scale=scale, $
_extra=extra
;+
; NAME:
; plotsym
; PURPOSE:
; function to make plotting symbols much easier.
; Usage:
; plot,x,y,psym=plotsym(/circle,scale=2,/fill)
;
; CATEGORY:
; Graphics.
;
; Keywords:
; circle = circle symbol
; triangle = triangle symbol
; diamond = diamond symbold
; box = box symbol
; line = line symbol
; scale = scales the symbol
; angle = angle the symbol should be rotated
; _extra = extra keywords for usersym. These are thick, color and fill
;
; Written by:
; Ronn Kling
; Ronn Kling Consulting
; 7038 Westmoreland Dr.
; Warrenton, VA 20187
; ronn@rlkling.com
;
;-
if not keyword_set(scale) then scale=1.0
if not keyword_set(angle) then angle=0.0
if keyword_set(circle) then begin
theta = findgen(30)/29.*360.
endif else if keyword_set(triangle) then begin
theta = [-30.,90.,210., -30.]
endif else if keyword_set(diamond) then begin
theta = [0.,90.,180.,270.,0.]
endif else if keyword_set(box) then begin
theta = [315.,45.,135.,225.,315.]
endif else if keyword_set(line) then begin
theta = [-180.,0.]
endif
theta = theta + angle
x = cos(theta * !dtor) * scale
y = sin(theta * !dtor) * scale
usersym, x,y, _extra=extra
return,8
end
----------------------------------------------
--
Ronn Kling
Ronn Kling Consulting
email: ronn@rlkling.com
"Application Development with IDL" programming book updated for IDL5.3!
Shareware and Freeware at: http://www.rlkling.com/
Sent via Deja.com http://www.deja.com/
Before you buy.
|
|
|