comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Plot symbols and symbol tables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Plot symbols and symbol tables [message #372] Mon, 27 April 1992 15:13 Go to next message
uuvince is currently offline  uuvince
Messages: 6
Registered: June 1991
Junior Member
I have recently started making multiple x-y curve plots with WAVE. I sometimes
have a need to plot up to 10 curves on a single plot. I was disappointed to
find that WAVE only has 7 built-in symbols and some of those are not very
pleasing aesthetically. Also, the LEGEND command which is provided for creating
symbol tables produces a double set of symbols if you specify the symbol type
as a positive number. I am interested in knowing if anyone has created a better
and/or more extensive set of symbols, and a better procedure for building a
symbol table.
On another subject, I would like to talk to anyone who has some experience with
using WAVE in a real-time application. We are evaluating methods for displaying
experimental data on both local and remote workstations in real time.
Replies on either subject would be appreciated.
Vince

------------------------------------------------------------ ------------------
| Vince Scullin | Never attribute to malice that |
| Scientific Data Applications Branch | which can be adequately explained |
| NASA Lewis Research Center | by ignorance. |
| Cleveland, Ohio 44135 uuvince@ariel.lerc.nasa.gov (Vince Scullin) |
------------------------------------------------------------ ------------------
Re: Plot symbols [message #8133 is a reply to message #372] Thu, 06 February 1997 00:00 Go to previous message
brian.jackel is currently offline  brian.jackel
Messages: 23
Registered: May 1996
Junior Member
In article <32F9F9E9.41C6@osf1.mpae.gwdg.de> Kevin Ivory <kivory2@osf1.mpae.gwdg.de> writes:

> * Has anyone defined a bunch of plotting symbols for use with
> graphics keyword psym=8 and usersym procedure? And are you
> willing to supply them to this group or to me?

Sure, why not. I've attached a little routine called UserSymbol which has
about a dozen symbols in it. I'd be interested in seeing what other people
have done.

> * Is it possible to get any character from the pre-defined IDL
> vector fonts (especially 'Simplex Roman' or 'Math and Special')
> and use it as a user defined plotting symbol with usersym?

Not that I know of. Overplotting with XYOUTS would work, but
that might not be what you're looking for.




;Brian Jackel University of Western Ontario
;Bug reports welcome, use at own risk
;brian.jackel@uwo.ca
;+
; NAME: UserSymbol
;
; PURPOSE: Make neat little user defined symbols
;
; CATEGORY: Plotting/Graphics
;
; CALLING SEQUENCE: UserSymbol,symbol_name
;
; INPUTS:
; Symbol_name a string containing the name of the desired symbol.
; Some possible options are Square, Triangle, Circle,
; Hexagon, BigX, Clover, Spiral, Star...
;
; KEYWORD PARAMETERS:
; SIZE Symbol size (default=1)
; LIST if set, puts the list of available symbol names
; in the input parameter Symbol_Name
; HELP if set, returns this documentation header
;
; and also the keywords which apply to USERSYM
; THICK Line thickness (default=1)
; FILL Fill symbol? (default=0=no)
; COLOR Symbol color

;
; SIDE EFFECTS: Calls USERSYM to load the new symbol
;
; MODIFICATION HISTORY: Brian Jackel August 10 1992
; University of Western Ontario
;
; Bjj June 2 1994 Fixed up the handling of no clear match.
;-
pro USERSYMBOL,symbol_name,SIZE=size,LIST=list,HELP=help,_EXTRA= _extra

ON_ERROR,2

IF KEYWORD_SET(HELP) THEN BEGIN
DOC_LIBRARY,'USERSYMBOL'
RETURN
ENDIF

symbol_list= ['DIAMOND','PENTAGON','CLOVER','PACMAN','SPIRAL','BIGX']
symbol_list= [symbol_list,'CIRCLE','SQUARE','TRIANGLE','STAR','HEXAGON']

IF KEYWORD_SET(LIST) THEN BEGIN
symbol_name= symbol_list
return ;return a list of the available symbols
ENDIF

IF not KEYWORD_SET(SIZE) THEN size=1.0

symbol= STRUPCASE( STRCOMPRESS(symbol_name,/REMOVE_ALL) )

CASE symbol OF
'DIAMOND': BEGIN
x= size* [0.0,0.8,0.0,-0.8,0.0]
y= size* [1.2,0.0,-1.2,0.0,1.2]
END
'PENTAGON':BEGIN
theta= findgen(6)/5 * 360.0 * !dtor
x= 1.0 *size* sin(theta)
y= 1.0 *size* cos(theta)
END
'CLOVER': BEGIN
theta= findgen(41)/40.0 * 360.0 * !dtor
r= ABS(1.0 *size* sin(2.0*theta))
x= r * sin(theta)
y= r * cos(theta)
END
'PACMAN': BEGIN
theta= (- findgen(41)/50.0*360.0 + 35.0 )*!dtor
x= [0.0, 1.0 *size* sin(theta), 0.0]
y= [0.0, 1.0 *size* cos(theta) ,0.0]
END
'SPIRAL': BEGIN
theta= findgen(41)/40.0 * 720.0 * !dtor
r= 1.0 *size* theta / MAX(theta)
x= r * sin(theta)
y= r * cos(theta)
END
'BIGX': BEGIN
x= 0.34 *size* [0,2,3,3,1, 3, 3, 2, 0,-2,-3,-3,-1,-3,-3,-2,0]
y= 0.34 *size* [1,3,3,2,0,-2,-3,-3,-1,-3,-3,-2, 0, 2, 3, 3,1]
END
'CIRCLE': BEGIN
n= 17.0
theta= findgen(n)/(n-1.0) * 360.0 * !dtor
x= 1.0 *size* sin(theta)
y= 1.0 *size* cos(theta)
END
'SQUARE': BEGIN
theta= (findgen(5)/4.0 * 360.0 + 45.0 )*!dtor
x= 1.0 *size* sin(theta)
y= 1.0 *size* cos(theta)
END
'TRIANGLE':BEGIN
theta= [0,120,240,360]*!dtor
x= 1.0 *size* sin(theta)
y= 1.0 *size* cos(theta)
END
'STAR': BEGIN
theta= [0,36, 72,108, 144,180, 216,252, 288,324,0]*!dtor
r= [1.0,0.5, 1.0,0.5, 1.0,0.5, 1.0,0.5, 1.0,0.5,1.0]
x= r *size* sin(theta)
y= r *size* cos(theta)
END
'HEXAGON': BEGIN
theta= [0,60,120,180,240,300,360]*!dtor
x= 1.0 *size* sin(theta)
y= 1.0 *size* cos(theta)
END
ELSE: BEGIN
MESSAGE,'Unrecognized symbol name, searching for match',/INFORMATIONAL
hits= STRPOS( symbol_list, symbol )
w= WHERE(hits NE -1)
IF (w(0) NE -1) THEN BEGIN ;at least one substring match, use
hit_names= symbol_list(w(0))
FOR i=1,n_elements(w)-1 DO hit_names= hit_names + $
' ' + symbol_list(w(i))
MESSAGE,'...possible matches: '+hit_names,/INFORMATIONAL
MESSAGE,'...will use the first (or only) one',/INFORMATIONAL
symbol_name= symbol_list(w(0)) ;recursion to help us out
USERSYMBOL,symbol_name,_EXTRA=_extra
ENDIF ELSE BEGIN
MESSAGE,'...no quick match. Try USERSYMBOL,list,/LIST',/INFORMATIONAL
ENDELSE
return ;either with a guessed symbol, or a list of them
END
ENDCASE

;User the library routine USERSYM to set up the symbol.
;
USERSYM,x,y,_EXTRA=_extra

RETURN
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Contour and 'Z-buffer'
Next Topic: Angstrom Symbol Nonsense

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:06:37 PDT 2025

Total time taken to generate the page: 0.00571 seconds