circle plot symbol [message #20150] |
Fri, 19 May 2000 00:00  |
refik
Messages: 1 Registered: May 2000
|
Junior Member |
|
|
Hi Folks,
First of all, you have quite an impressive news group.
Well, I Have a simple question. How do I code a circle as a symbol in a
plot ? All the symbols in my plots so far are squares, diamonds and
triangles, i.e. codes 2, 3, 4, etc...
Can anybody tell me the number or code for a "simple circle" to use in PSYM= ?
Thanks
Refik
P.S. I am a biology graduate student and trying to get rid some of the
Excel graphs from my dissertation. I have used IDL 3.6 on Alpha UNIX for
1.5 years, and I am starting to use it again at home on the demo 5.3 until
I get the student 4.0 comes in. I like it for multi-panel graphs,
contour-plots, and histograms. Well, no circles yet...
|
|
|
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.
|
|
|