Coyote Graphics Routines

Date: Thu May 17 08:12:58 2012

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

.\

cgsymbol.pro


Routines

cgSymbol_Example [, /PS] [, /UNICODE]

This function provides a device-independent way to ask for commonly-used symbols (e.g., less than or equal to, Angstrom, degree symbol, etc.), including all 24 Greek symbols in upper and lower case, to display with text.

result = cgSymbol(symbol [, /CAPITAL] [, /EXAMPLE] [, /PS] [, /UNICODE])

This function provides a device-independent way to ask for commonly-used symbols (e.g., less than or equal to, Angstrom, degree symbol, etc.), including all 24 Greek symbols in upper and lower case, to display with text.

Routine details

top cgSymbol_Example

Graphics

cgSymbol_Example [, /PS] [, /UNICODE]

This function provides a device-independent way to ask for commonly-used symbols (e.g., less than or equal to, Angstrom, degree symbol, etc.), including all 24 Greek symbols in upper and lower case, to display with text.

For this program to work correctly on your graphics display, you should be using Hershey fonts (!P.Font=-1). It will work correctly in PostScript with either hardware fonts (!P.Font=0) or True-Type fonts (!P.Font=1).

Greek Symbols are created by calling the Coyote Library routine Greek from this program.

Keywords

PS in optional type=boolean default=0

Normally, the PostScript version of the symbol is returned automatically if the current device is PostScript and !P.Font is 0 or 1. But, the PostScript version of the symbol can be obtained at any time and in any device, by setting this keyword.

UNICODE in optional type=boolean default=0

If this keyword is set, the function returns the Unicode value for the symbol.

Examples

To create a lowercase Greek psi symbol: IDL> cgPlot, findgen(11), XTitle='This title contains ' + $ cgSymbol('psi') + ' as a Greek letter' To create an Angstrom sign: IDL> cgPlot, findgen(11), XTitle='This title contains (' + $ cgSymbol('Angstrom') + ') an Angstrom sign.'

Author information

Author:

FANNING SOFTWARE CONSULTING: David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com

Copyright:

Copyright (c) 2011, Fanning Software Consulting, Inc. Displays the symbols and their names in a graphics window.

History:

Change History: Written by: David W. Fanning, 2 September 2011. Added plus-minus symbol. 2 Nov 2011. DWF.

top cgSymbol

result = cgSymbol(symbol [, /CAPITAL] [, /EXAMPLE] [, /PS] [, /UNICODE])

This function provides a device-independent way to ask for commonly-used symbols (e.g., less than or equal to, Angstrom, degree symbol, etc.), including all 24 Greek symbols in upper and lower case, to display with text.

Parameters

symbol in required type=string default=alpha

The name of the symbol desired as a string. Valid string names are the 24 characters of the Greek alphabet, plus commonly used graphical symbols: alpha nu leq beta xi geq gamma omicron neg delta pi deg epsilon rho equiv zeta sigma prime eta tau angstrom theta upsilon sun iota phi varphi kappa chi infinity lambda psi copyright mu omega Note that if the first letter of the name is capitalized, this is the equivalent of setting the Capital keyword. Only Greek characters use this method of selecting symbols.

Keywords

CAPITAL in optional type=boolean default=0

If this keyword is set, the captial Greek letter is returned rather than the lowercase Greek letter. An alternative way of capitalizing the letter is to make the first letter of the name an uppercase letter.

EXAMPLE in optional type=boolean default=0

If this keyword is set, the names of symbols and the symbols themselves are written out in the current graphics window.

PS in optional type=boolean default=0

Normally, the PostScript version of the symbol is returned automatically if the current device is PostScript and !P.Font is 0 or 1. But, the PostScript version of the symbol can be obtained at any time and in any device, by setting this keyword.

UNICODE in optional type=boolean default=0

If this keyword is set, the function returns the Unicode value for the symbol.

File attributes

Modification date: Wed Dec 07 11:03:10 2011
Lines: 366
Docformat: rst rst