mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/directgraphics/

mg_usersym.pro

direct graphics

includes main-level program

Creates a user-defined symbol for use in plotting in direct graphics via routines that accept the PSYM graphics keyword. All user symbols are scaled to fill the -1 to 1 range (use SYMSIZE of the graphics routine to change the size of the symbol).

Examples

Try the main-level example program at the end of this file:

IDL> .run mg_usersym
The core lines of code to produce the plot are:
plot, [0, 1], [0, 1], /nodata, xrange=[0, 1], yrange=[0, 1], $ xstyle=9, ystyle=9 oplot, randomu(seed, 10), randomu(seed, 10), $ psym=mg_usersym(/circle, /fill, color=128B) oplot, randomu(seed, 10), randomu(seed, 10), $ psym=mg_usersym(/triangle, rotation=90, /fill) oplot, randomu(seed, 10), randomu(seed, 10), $ psym=mg_usersym(/triangle, rotation=-90, color=64B) oplot, randomu(seed, 10), randomu(seed, 10), $ psym=mg_usersym(/hexagon)
It should look something like:

Routines

top mg_usersym

result = mg_usersym( [x] [, y] [, color=color] [, /fill] [, thick=float] [, /with_line] [, /none] [, /plus_sign] [, /asterisk] [, /dot] [, /diamond] [, /x] [, /user_defined] [, /histogram] [, /horizontal_line] [, /vertical_line] [, /triangle] [, /square] [, /hexagon] [, /circle] [, n_vertices=long] [, rotation=float])

Create a user symbol.

Return value

correct PSYM value for pre-defined types, 8 for the special symbols, i.e. PSYM=8 means use the current user symbol

Parameters

x in optional type=fltarr

x-values of the user symbol's shape

y in optional type=fltarr

y-values of the user symbol's shape

Keywords

color in optional type=color

color for the symbol

fill in optional type=boolean

set to fill inside the symbol

thick in optional type=float default=1.0

line thickness of the symbol

with_line in optional type=boolean

set to display symbols and a line connecting them; the default is to show just the symbol

none in optional type=boolean

set to produce no symbol

plus_sign in optional type=boolean

set to produce a plus sign symbol

asterisk in optional type=boolean

set to produce an asterisk symbol

dot in optional type=boolean

set to produce a dot symbol

diamond in optional type=boolean

set to produce a diamond symbol

x in optional type=boolean

set to produce an x symbol

user_defined in optional type=boolean

set to use the currently defined user symbol

histogram in optional type=boolean

set to use histogram mode

horizontal_line in optional type=boolean

set to produce a horizontal line user symbol

vertical_line in optional type=boolean

set to produce a vertical line user symbol

triangle in optional type=boolean

set to produce a triangular user symbol

square in optional type=boolean

set to produce a square

hexagon in optional type=boolean

set to produce a hexagonal user symbol

circle in optional type=boolean

set to produce a circular user symbol

n_vertices in optional type=long

number of vertices for a regular polygonal symbol

rotation in optional type=float default=0.0

angle in degrees to rotate the symbol; 0 degrees places the first vertex at (1, 0) in user symbol coordinate space

File attributes

Modification date: Wed May 14 15:07:15 2014
Lines: 83
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.