.\
cgcolorfill.pro
top cgColorFill
Graphics
cgColorFill, x, y [, z] [, /CHECKFORFINITE] [, COLOR=string/byte/integer/long] [, MAP_OBJECT=object] [, /NORMAL] [, /DEVICE] [, POSITION=float] [, /WINDOW] [, _REF_EXTRA=appropriate]
Provides a device-independent and color-model-independent way to fill a polygon with a particular color. This is a wrapper to the PolyFill command in IDL.
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
- CHECKFORFINITE in optional type=boolean default=0
If the input data is not finite (i.e., it contains NaNs), then the drawing of the polygons will be affected. This is particularly true if you are drawing polygons on map projections using the
Map_Object
keyword. The program could check all input for NaNs, but this would be quite slow when a great number of polygons are being drawn. For this reason, the program only checks polygon input when this keyword is set. Only polygons containing all finite values are drawn when this keyword is set.- COLOR in optional type=string/byte/integer/long default=rose
The name of the 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.
- MAP_OBJECT in optional type=object
If you are drawing on a map projection set up with Map_Proj_Init and using projected meter space, rather than lat/lon space, then you can use this keyword to provide a cgMap object that will allow you to convert the
x
andy
parameters from longitude and latitude, respectively, to projected meter space before drawing. X and Y must both be present.- 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=float
Set to the normal four-element normalized position array for locating a rectangular region in a graphics window. If this keyword is used, the x and y parameters are constructed from this position.
- 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 Polyfill command:
IDL> cgColorFill, [0.25, 0.25, 0.75, 0.75, 0.25], [0.25, 0.75, 0.75, 0.25, 0.25], $
/NORMAL, COLOR='blue'
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) 2010-2014, Fanning Software Consulting, Inc.
- History:
Change History:
Written, 24 December 2010. DWF. In some cases, I was turning BYTE values to strings without converting to INTEGERS first. 30 Dec 2010. DWF. Moved setting to decomposed color before color selection process to avoid PostScript background problems when passed 24-bit color integers. 12 Jan 2011. DWF. Added WINDOW keyword. 24 Jan 2011. DWF. Modified error handler to restore the entry decomposition state if there is an error. 17 March 2011. DWF Modified to use cgDefaultColor for default color selection. 24 Dec 2011. DWF. Added a POSITION keyword to allow setting the color position in a graphics window. 24 Jan 2013. DWF. Added a MAP_OBJECT keyword to allow polygon filling on maps. 13 Dec 2013. DWF. Completely forgot to deconstruct a single parameter into component parts. 11 Jan 2014. DWF. Added CheckForFinite keyword to check output for NaN values before display. 22 Jan 2014. DWF.
File attributes
Modification date: | Fri Mar 27 11:07:36 2015 |
Lines: | 255 |
Docformat: | rst rst |