Coyote Graphics Routines

Date: Wed May 22 08:12:34 2013

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

.\

cgpolygon.pro


top cgPolygon

Graphics

cgPolygon, x, y [, z] [, /ADDCMD] [, COLOR=string] [, FCOLOR=string/integer/long] [, /FILL] [, /NORMAL] [, /DEVICE] [, POSITION=fltarr(4)] [, /WINDOW] [, _REF_EXTRA=appropriate]

Provides a device-independent and color-model-independent way to draw a filled or unfilled polygon.

The program requires the Coyote Library to be installed on your machine.

Parameters

x in required type=number

A vector argument providing the X coordinates of the points to be connected. The vector must contain at least three elements. If only one argument is specified, X must be an array of either two or three vectors (i.e., (2,*) or (3,*)). In this special case, the vector X[0,*] specifies the X values, X[1,*] specifies Y, and X[2,*] contain the Z values.

y in required type=number

A vector argument providing the Y coordinates of the points to be connected. Y must contain at least three elements.

z in optional type=number

An optional vector argument providing the Z coordinates of the points to be connected. Z must contain at least three elements.

Keywords

ADDCMD in optional type=boolean default=0

Set this keyword to add the command to an cgWindow. Setting this keyword automatically sets the WINDOW keyword, but the command does not erase the graphics window as it would normally.

COLOR in optional type=string default=rose

The name of the polygon color. Color names are those used with cgColor. This value can also be a long integer or an index into the current color table.

FCOLOR in optional type=string/integer/long

The name of the polygon fill color. Color names are those used with cgColor. This value can also be a long integer or an index into the current color table. The default is the same as Color.

FILL in optional type=boolean default=0

Set this keyword to draw a filled polygon, rather than an open polygon.

NORMAL in optional type=boolean default=0

Set to indicate the polygon vertices are in normalized coordinates.

DEVICE in optional type=boolean default=0

Set to indicate the polygon vertices are in device coordinates.

POSITION in optional type=fltarr(4)

Set this keyword to a four-element position array of normalized coordinates to fill a rectangular area on the graphics display. The normal input parameters are ignored if this keyword is set.

WINDOW in optional type=boolean default=0

Set this keyword to add the command to the current cgWindow application.

_REF_EXTRA in optional type=appropriate

Any other keywords to the IDL POLYFILL command may be used.

Examples

Used like the IDL Plots or Polyfill commands:

IDL> cgPolygon, [0.25, 0.25, 0.75, 0.75, 0.25], [0.25, 0.75, 0.75, 0.25, 0.25], $ /NORMAL, COLOR='blue' IDL> cgPolygon, [0.25, 0.25, 0.75, 0.75, 0.25], [0.25, 0.75, 0.75, 0.25, 0.25], $ /NORMAL, COLOR='blue', FCOLOR='rose', /FILL

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) 2012, Fanning Software Consulting, Inc.

History:

Change History:

Written, 26 March 2012. David Fanning. Added Position keyword to allow a fill of a particular portion of the graphics window. 20 Apr 2012. DWF. Added AddCmd keyword. 25 Oct 2012. DWF.

File attributes

Modification date: Wed Dec 26 14:10:54 2012
Lines: 246
Docformat: rst rst