Coyote Graphics Programs
These are programs from the Coyote Library that are specifically identified as being associated with the Coyote Graphics System. Documentation for Coyote Graphics routines is now available on-line.
Alphabetical List of Commands
- cgARROW Draws an arrow in a graphics window.
- cgAXIS A device/color independent wrapper for the AXIS command.
- cgBARPLOT Draws data as a bar plot.
- cgBLENDIMAGE Allows the user to blend two images together.
- cgBOXPLOT Draws data as a box and whisker plot.
- cgCOLOR The heart and soul of the Coyote Graphics system!
- cgCOLORBAR Creates direct graphics color bar.
- cgCOLORFILL A device-independent and color-independent wrapper for the POLYFILL command.
- cgCONLEVELS A function for creating contour levels for the cgContour command.
- cgCONTAINER A modified IDL_Container object with properties important for Coyote Graphics.
- cgCONTOUR A device-independent and color-independent wrapper for the CONTOUR command.
- cgCONTROL A routine for setting and controlling cgWINDOW properties.
- cgCOORD A coordinate object for Coyote Graphics routines.
- cgDCBAR A discrete color bar with a handful of colors and centered labels.
- cgDEFAULTCOLOR This function defines a default color for Coyote Graphics routines.
- cgDEFCHARSIZE A routine define the default character size for Coyote Graphics routines.
- cgDELETE A routine to delete an cgWINDOW from the display.
- cgDEMODATA Opens data files found in the IDL distribution.
- cgDISPLAY A device-independent and color-independent wrapper for the WINDOW command.
- cgERASE A wrapper for ERASE that erases window in white color.
- cgHISTOPLOT Draws a histogram plot (direct graphics).
- cgIMAGE Device independent replacement for TV. Works with !P.Multi and Position keyword.
- cgIMAGEINFO Works with cgIMAGE to display interactive image locations and values.
- cgLOADCT A drop-in replacement for LOADCT with additional functionality.
- cgPLOT A device-independent and color-independent wrapper for the PLOT command.
- cgPLOTS A device-independent and color-independent wrapper for the PLOTS command.
- cgPOLYGON A device-independent and color-independent program for creating filled or unfilled polygons.
- cgPS2PDF A device-independent way to create PDF files from PostScript intermediary files.
- cgPS2RASTER Create BMP, GIF, JPEG, PNG, and TIFF files from PostScript intermediary files.
- cgQUERY A utility routine to gather information about cgWINDOW applications on the display.
- cgRANDOMINDICES Create random indices without replacement (unique indices).
- cgSCATTER2D Creates a scatter plot between two variables.
- cgSET A WSet command for cgWINDOW.
- cgSHOW A WShow command for cgWINDOW.
- cgSNAPSHOT Device independent replacement/upgrade for TVRD. Creates raster files directly.
- cgSURF A device-independent and color-independent wrapper to the SURFACE and SHADE_SURF commands.
- cgSURFACE A full-rotating, object graphics surface command with texture mapping.
- cgSYMBOL Draws device independent Greek (φ, ξ, λ, etc.) and other symbols (Å, ≠, ≡, etc.) in programs.
- cgTEXT A wrapper for XYOUTS that writes (and places) text in a color independent manner.
- cgWINDOW_GETDEFS Gets default values for cgWINDOW.
- cgWINDOW_SETDEFS Sets default values for cgWINDOW.
- cgWINDOW A "smart" graphics window. Resizeable with automatic file output.
![]()
cgARROW | |
| This program draws an arrow on a graphics display. It is similar to the old Arrow command in IDL that now conflicts with the Arrow object in IDL 8. Set the WINDOW keyword to add this command to an cgWindow application. |
cgAXIS | |
| This program is a wrapper for the AXIS command and is meant to work seamlessly with the other other Coyote Graphics programs in this device independent, color independent series. Set the WINDOW keyword to add this command to an cgWindow application. |
cgBARPLOT | |
| Draws data as a bar plot.
|
cgBLENDIMAGE | |
| This is an extremely simple program that will "blend" or "fuse" two 24-bit true-color
images using alpha blending. You set the alpha value to a number between 0 and 1 to select
the percentage of background image pixels to use in the blended image. For example, ALPHA=0.8
will use 80% of the background pixel values and 20% of the foreground pixel values in the
blended image. The program is a wrapper to the cgImage
command and can use all the features and keywords of that command. The figure below shows
two MODIS images on the left (MOD02) and middle (MOD29), and the blended image on the right. An ALPHA value
of 0.75 was used to create the blended image.
|
cgBOXPLOT | |
| Draws data as box and whisker plots. Here
is example output from plotting the Michaelson-Morely data from
their speed of light experiments.
|
cgCOLOR | |
| This program is a completely device-independent program for specifying
colors by name. You can ask for and load any one (or all) of the nearly 200 colors
defined in the program by name.
The colors available are the ones defined for
the PickColorName program:
To see a list of all the colors available by name, type this:
IDL> Print, cgColor(/Names), Format='(5(A14, 2x))'
WHITE SNOW IVORY LIGHTYELLOW CORNSILK
BEIGE SEASHELL LINEN ANTIQUEWHITE PAPAYA
ALMOND BISQUE MOCCASIN WHEAT BURLYWOOD
TAN LIGHTGRAY LAVENDER MEDIUMGRAY GRAY
SLATEGRAY DARKGRAY CHARCOAL BLACK HONEYDEW
LIGHTCYAN POWDERBLUE SKYBLUE CORNFLOWERBLUE CADETBLUE
STEELBLUE DODGERBLUE ROYALBLUE BLUE NAVY
PALEGREEN AQUAMARINE SPRINGGREEN CYAN TURQUOISE
LIGHTSEAGREEN SEAGREEN FORESTGREEN TEAL GREENYELLOW
CHARTREUSE LAWNGREEN GREEN LIMEGREEN OLIVEDRAB
OLIVE DARKGREEN PALEGOLDENROD KHAKI DARKKHAKI
YELLOW GOLD GOLDENROD DARKGOLDENROD SADDLEBROWN
ROSE PINK ROSYBROWN SANDYBROWN PERU
INDIANRED CHOCOLATE SIENNA DARKSALMON SALMON
LIGHTSALMON ORANGE CORAL LIGHTCORAL FIREBRICK
DARKRED BROWN HOTPINK DEEPPINK MAGENTA
TOMATO ORANGERED RED CRIMSON VIOLETRED
MAROON THISTLE PLUM VIOLET ORCHID
MEDIUMORCHID DARKORCHID BLUEVIOLET PURPLE SLATEBLUE
DARKSLATEBLUE WT1 WT2 WT3 WT4
WT5 WT6 WT7 WT8 TAN1
TAN2 TAN3 TAN4 TAN5 TAN6
TAN7 TAN8 BLK1 BLK2 BLK3
BLK4 BLK5 BLK6 BLK7 BLK8
GRN1 GRN2 GRN3 GRN4 GRN5
GRN6 GRN7 GRN8 BLU1 BLU2
BLU3 BLU4 BLU5 BLU6 BLU7
BLU8 ORG1 ORG2 ORG3 ORG4
ORG5 ORG6 ORG7 ORG8 RED1
RED2 RED3 RED4 RED5 RED6
RED7 RED8 PUR1 PUR2 PUR3
PUR4 PUR5 PUR6 PUR7 PUR8
PBG1 PBG2 PBG3 PBG4 PBG5
PBG6 PBG7 PBG8 YGB1 YGB2
YGB3 YGB4 YGB5 YGB6 YGB7
YGB8 RYB1 RYB2 RYB3 RYB4
RYB5 RYB6 RYB7 RYB8 TG1
TG2 TG3 TG4 TG5 TG6
TG7 TG8 OPPOSITE
The normal calling sequence for producing device-independent drawing colors, will look similar to this. The first parameter is the name of the color you want, the second parameter is the color table index where you would like to load the specified color.
axisColor = cgCOLOR("Green", !D.Table_Size-2)
backColor = cgCOLOR("Dark Gray", !D.Table_Size-3)
dataColor = cgCOLOR("Yellow", !D.Table_Size-4)
Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
OPlot, Findgen(11), Color=dataColor
If color decomposition is turned off, then the color is loaded at the specified index. If color decomposition is turned on, then no color is loaded into the color table. If a color index is not specified and color decomposition is turned off, then the specified color is loaded into the !P.Color index. The output of these commands looks like this:
The value that is returned by cgCOLOR depends upon the keywords used to call it and on the version of IDL you are using. In general, the return value will be either a color index number where the specified color is loaded by the program, or a 24-bit color value that can be decomposed into the specified color on true-color systems. If you are running IDL 5.2 or higher, the program will determine which return value to use, based on the color decomposition state at the time the program is called. If you are running a version of IDL before IDL 5.2, then the program will return the color index number. This behavior can be overruled in all versions of IDL by setting the DECOMPOSED keyword. If this keyword is 0, the program always returns a color index number. If the keyword is 1, the program always returns a 24-bit color value. If the TRIPLE keyword is set, the program always returns the color triple, no matter what the current decomposition state or the value of the DECOMPOSED keyword. This is useful, for example, if you want to load a color in the color table yourself.
IDL> TVLCT, cgColor('dodger blue', /Triple), 10
If the ALLCOLORS keyword is used, then instead of a single value, modified as described above, then all the color values are returned in an array. In other words, the return value will be either an NCOLORS-element vector of color table index numbers, an NCOLORS-element vector of 24-bit color values, or an NCOLORS-by-3 array of color triples. This program can also read an ASCII file of color names and values, so you don't have to use the nearly 200 colors provided. And if you prefer to have the user select a color name, you can use the SELECTCOLOR keyword. (This requires PickColorName.) For example, suppose you want the RGB color triple of a user-supplied color. You would type this: IDL> color = cgCOLOR(/SelectColor, /Triple) IDL> Print, color The output keyword COLORSTRUCTURE is useful if you want to get all of the colors in a structure variable with the color names as fields in the structure. IDL> d = cgCOLOR(/AllColors, ColorStructure=c) IDL> Plot, Findgen(11), Color=c.green, Background=c.charcoal, /NoData IDL> OPlot, Findgen(11), Color=c.dodgerblue It is also possible to specify a vector of color names. For example, if you are overploting several lines in a plot, and you wish to each to have a different color, you might do this: x = Findgen(101) * 10/101. y = FltArr(3,101) FOR j=0,2 DO y[j,*] = cgDemoData(17) cgPlot, x, y[0,*], AxisColor='yellow', Background='charcoal', /NoData colors = ['dodger blue', 'indian red', 'pale green'] FOR j=0,2 DO cgPlot, x, y[j,*], Color=colors[j], /Overplot The plot might look something like this.
|
cgCOLORBAR | |||
This program shows you one way to create a color bar for your programs.
This color bar appears exactly the same in a PostScript file as
it does on your display. You can easily create continuous or discrete color bars.
|
cgCOLORFILL | |
| This program is a wrapper for the POLYFILL command. It fills a polygon with a color or "texture." Set the WINDOW keyword to add this command to an cgWindow application. |
cgCONLEVELS | |||||
| The cgContour program specializes in producing equally spaced contour intervals. But, depending
on the data, the levels are not always "nicely" spaced or formatted. The role of the cgConLevels function
is to address this problem by providing an easy and intuitive way to produce contour levels that
look nice on contour plots.
Here is code that produces a "normal" contour plot with 10 equally-spaced contour intervals.
cgDisplay, WID=0
data = Scale_Vector(cgDemoData(2), 0.1, 4534.5)
cgLoadCT, 33, NColors=10, Bottom=1
cgContour, data, NLevels=10, /Fill, /Outline, $
Position=[0.1, 0.1, 0.9, 0.75], C_Colors=Indgen(10)+1
cgColorbar, NColors=9, Bottom=1, /Discrete, /Fit, $
Range=[Min(data), Max(data)], OOB_High=10, OOB_Low='white'
Here is code that use cgConLevels to produce the contour levels.
cgDisplay, WID=1
data = Scale_Vector(cgDemoData(2), 0.1, 4534.5)
cgLoadCT, 33, NColors=10, Bottom=1
levels = cgConLevels(data, Factor=100, MINVALUE=0)
cgContour, data, Levels=levels, /Fill, /Outline, $
Position=[0.1, 0.1, 0.9, 0.75], C_Colors=Indgen(10)+1
cgColorbar, NColors=9, Bottom=1, /Discrete, /Fit, $
Range=[Min(levels), Max(levels)], OOB_High=10, OOB_Low='white'
|
cgCONTAINER | |
| This is a subclassed IDL_Container object that contains properties that are used with other Coyote Graphics routines. |
cgCONTOUR | |
| This program does for the CONTOUR command what
the cgIMAGE command did
for TV command. In other words, it makes the CONTOUR command
obsolete, by giving users a useable device-independent, color-independent tool
for producing graphics on modern computers. See the article
Device Independent Contour Plots
for additional information and screen shots. Below are pictures of basic Contour plots (on the left) verses
cgContour plots (on the right), in both regular and filled versions. Set the Window keyword to
add this command to an cgWindow application.
|
cgCONTROL | |
| This routine allows the user to control various internal properties of a cgWindow application, including the ability to load images with and without immediate execution and the ability to programmatically create PostScript and raster file output from the window. The program is essentially a conduit to the SetProperty method of the underlying cgWindow object. |
cgCOORD | |
| This is a subclassed cgContainer object that maintains a rectangular data coordinate system for other Coyote Graphics objects and programs. |
cgDCBAR | |
| This program produces a discrete color bar with a handful, say 3 to 20 colors. Labels
are centered (either horizontally or vertically) for each color, and the labels can be
rotated, if needed, to keep an uncluttered display. The colorbar can be displayed either
horizontally or vertically anywhere in the display window. You can learn more about how
this program works by reading the Discrete Color Bar
article on my web page.
|
cgDEFAULTCOLOR | |
The purpose of this function is to choose a default color for Coyote Graphics routines. The input can be a string, a byte or integer, or a
long integer. If the input is a long integer, the function will evaluate
the value depending upon the current color state. If using indexed color,
and the long integer is in the range 0-255, the long integer is interpreted as a color table index number. The output is generally passed
to cgColor to obtain the actual
color used in the program.
color = cgDefaultColor(inputColor, Default='Opposite')
IF Size(color, /TNAME) EQ 'STRING' THEN color = cgColor(color)
|
cgDEFCHARSIZE | |
| This program selects the default character size for Coyote Graphics programs. Character size is based on several factors, including operating system, font type, and whether multiple plots are being displayed. In no case is the character size changed by the program if the !P.Charsize system variable is not set to its default value of 0.0. The character sizes returned are meant to emulate the slightly larger default character sizes used in the IDL 8 function graphics system. |
cgDELETE | |
| This command allows you to delete any or all cgWindow applications on the display. cgWindow applications can be selected by window index number, window title, widget identifier, or object reference. Set the ALL keyword to delete all the cgWindow applications on the display. |
cgDEMODATA | |
| This program is a utility routine for reading data files that are found in the IDL distribution, primairly in the $IDL_DIR/examples/data subdirectory. I use it when I teach IDL courses to get data of various types so I don't have to keep opening and closing files all the time. It is not particularly well written, but many of my code examples work better when you have a tool for loading data quickly. :-) |
cgDISPLAY | |
| This program is a wrapper for the WINDOW command. It erases a graphics window in a device and color independent way. Colors can be specified as color names. The default color is "white." This program automatically “protects ”the WINDOW command from devices that do not support windows. It is used to create IDL graphics windows in programs that are meant to work identically on the display and in other devices, such as the PostScript device, that do not support windows. If issued while in the PostScript device, a "window" with the same aspect ratio as the window that would be created on the display is specified. Using this program to open windows is one way to ensure your PostScript output looks identical to your display output. |
cgERASE | |
| This program is a wrapper for the ERASE command. It erases a graphics window in a device and color independent way. Colors can be specified as color names. The default color is "white." Set the WINDOW keyword to erase (delete) all the commands from an cgWindow graphics display before the display is erased with the specified color. |
cgHISTOPLOT | |
| A program for drawing a histogram plot that actually looks like a histogram plot.
The histogram bars can be filled with lines (for black and white printing) or with
colors. By setting an OPLOT keyword, you can overplot histograms on already exisiting
axes. The cumulative probability distribution function can be obtained and/or plotted
on the histogram plot. Set the WINDOW keyword to
add this command to an cgWindow application.
|
cgIMAGE | |
| This program allows you to display and position an image in a output
display window with the Position keyword, just like other IDL graphics output.
The advantage of this is that output looks the same in PostScript windows
as well as display windows and it is trivial to use images along with
other IDL graphics commands in the same window. The aspect ratio of the
image can be preserved in the output window if desired. The program has
been updated to honor the !P.Multi setting, so you can position images in
windows exactly the way you do plots.
This is a replacement program for the TV command.
The program automatically determines
if an 8-bit or 24-bit image is being
displayed and sets the Decomposition and True keywords appropriately.
This is a true device-, image-, and display-independent program.
This is far and away the most useful program in my library!
The program has been updated on 18 March 2008 to accept a SCALE keyword that will allow the image argument to be byte scaled before display. An AXES keyword has also been added, which will add a set of axes to the image. |
cgIMAGEINFO | |
| This program works with cgIMAGE to allow the user to interactively determine image location and values for the displayed image. Further information is contained in this article on my web page. |
cgLOADCT | |
| A utility routine that is a drop-in replacement for LOADCT, with additional
functionality and a correction to one of my favorite pet peeves. A REVERSE keyword
allows the user to reverse the color table vectors prior to loading. A CLIP keyword
allows the user to clip the normal color table vector to just a portion of the
original color table vectors. I find this useful, for example, when I want a reduced
number of colors in the color table, and I want to exclude the color table end-colors
(for most IDL color tables these are black and white).
For example, suppose I wish to use the Standard Gamma color table (color table 5), but I wish to exclude, the black color at the bottom, and the white color at the top. I might type: "cgLOADCT, 5, CLIP=[16,240]". The color bar at top in the figure below was created by loading colors with this command: IDL> LoadCT, 5, NCOLORS=8 The color bar below was created by loading colors with this command: IDL> cgLoadCT, 5, NCOLORS=8, CLIP=[16,240]
In addition, one of my favorite pet peeves is corrected by having all color table loading done silently. Updated on 14 May 2008 to support Brewer Colors. You will need to download the fsc_brewer.tbl file from Coyote Library to use this functionality. Install it either in the $IDL_DIR/resource/colors directory or in any directory in the IDL path. |
cgPLOT | |
| This program does for the PLOT command what the cgIMAGE command did for TV command. In other words, it makes the PLOT command obsolete, by giving users a useable device-independent, color-independent tool for producing graphics on modern computers. Set the WINDOW keyword to add this command to an cgWindow application. |
cgPLOTS | |
This program is a device-independent, color-independent wrapper for the PLOTS command.
Data colors (Color keyword), symbol colors (SymColor keyword), and symbol size (SymSize keyword)
can all be vectors, unlike the PLOTS command. This allows you to draw plots with multicolored lines, multicolored symbols, and/or multisized symbols. Set the WINDOW keyword to
add this command to an cgWindow application.
IDL> data = cgDemoData(1)
IDL> time = Scale_Vector(Findgen(101), 0, 6)
IDL> LoadCT, 33, /Silent
IDL> cgPlot, time, data, /NODATA, XTITLE='Time', YTITLE='Signal'
IDL> cgPlotS, time, data, PSYM=-16, COLOR=BytScl(data), $
SYMCOLOR=BytScl(data), SYMSIZE=Scale_Vector(data, 1.0, 2.5)
|
cgPOLYGON | |
| This command allows you draw a filled or unfilled polygon on the display. Polygons can be created in two or three dimensions, and the fill color can be different from the polygon outline color. |
cgPS2PDF | |
| This program takes advantage of third-party free software (Ghostscript, pstopdf, epstopdf, etc.) to create a machine independent way to create PDF files from PostScript intermediate files. It is not my intention to reinvent the wheel, but I did need a way to create PDF files automatically from within a cgWindow program, and this program does the job. On-line documentation for this program is available. |
cgPS2RASTER | |
| This program takes advantage of the ImageMagick convert command to convert PostScript intermediate files to BMP, GIF, JPEG, PNG, or TIFF raster files in a machine independent way. On-line documentation for this program is available. |
cgQUERY | |
This command allows
you obtain information about all the cgWindow applications currently on the display.
You can obtain their window index numbers, the identifiers of their top-level base
widgets, their window titles, and their object references. If the CURRENT keyword is
set, the same information can be obtained for just the current cgWindow application.
IDL> windowIDs = cgQuery(WIDGETID=tlbIDs, OBJECTREF=objRefs, TITLE=winTitles, COUNT=count) IDL> FOR j=0,count-1 DO Print, windowIDs[j], ' ', winTitles[j] |
cgRANDOMINDICES | |
This command allows the user to select a certain number of random indices out of a
selection vector. The indices are selected without replacement, which means you get a list
of unique indices. (None are repeated.) For example, to select 10 random indices out of
a vector of 100 random indices, you would type this.
IDL> indices = cgRandomIndices(100, 10, SEED=seed)
IDL> Print, indices
7 13 20 21 32 44 50 66 80 93
|
cgSCATTER2D | |
| This program allows you to create a scatter plot between two variables.
It is similar to a plot command, but in addition it optionally calculates the Pearson
correlation coefficient and plots a best-fit straight line though the data.
The fitting parameters can be retrieved from the program and/or displayed on the
data plot. On-line documentation for
the program is available.
|
cgSNAPSHOT | |
| This program is a device independent replacement for the IDL TVRD program. It returns an 8-bit image when called on 8-bit displays and a 24-bit pixel interleaved image when called on 24-bit displays. Optional keywords can produce BMP, GIF, JPEG, PICT, PNG, and TIFF file output automatically. |
cgSURF | |
| This program does for the SURFACE and SHADE_SURF commands what the cgIMAGE command did for TV command. In other words, it makes the SURFACE and SHADE_SURF commands obsolete, by giving users a useable device-independent, color-independent tool for producing graphics on modern computers. Set the WINDOW keyword to add this command to an cgWindow application. |
cgSURFACE | |||||
| This program has been completely re-written in Nov 2010 to be a fully-capable
surface command along the lines of the traditional surface command, cgSurf.
It uses most of the the same keywords and acts in a similar fashion, but adds a great deal
more functionality, including interactivity. Users can rotate and zoom into and out of the surface
with the mouse, change colors and other surface properties at will, and save the surface
to a number of output file types, including PostScript. Four lights illuminate the surface,
and users have complete control over the color and intensity of these lights. The lights
can be turned on or off to change surface features. Any 2D or true-color image can be added
to the surface as a texture map.
This program won the IDL Code Contest, sponsored by Research Systems, Inc. to inaugurate their User Contribution Library in November 2002.
| |||||
cgTEXT | |
This program is a wrapper for XYOUTS and is meant to work seamlessly with the other
cg*** programs in this device independent, color independent series. It can choose
its color based on the background color of the graphics window. If the PLACE keyword is
set, the user can click inside the current graphics window to set text at the cursor
location. Set the WINDOW keyword to
add this command to an cgWindow application.
IDL> cgText, 0.5, 0.5, 'Centered Text', /ALIGNMENT=0.5, COLOR='dodger blue' IDL> cgText, /PLACE, 'Use CURSOR to Locate this Text', COLOR='red8' |
cgSET | |
| This command is the equivalent of the WSet command for normal IDL graphics windows. It allows you to select a cgWindow application on the display and make it the "current" cgWindow application. Graphics commands are normally added to the current graphics display window. cgWindow applications can be selected by window index number, window title, widget identifier, or object reference. |
cgSHOW | |
| This command is the equivalent of the WShow command for normal IDL graphics windows. It allows you to move a cgWindow application forwand on the display without making it the "current" cgWindow application. Graphics commands are normally added to the current graphics display window. cgWindow applications can be selected by window index number, window title, widget identifier, or object reference. |
cgSYMBOL | |
| This command allows you to create device independent Greek (φ, ξ, λ, etc.) and other symbols (Å, ≠, ≡, etc.) in your IDL programs. The symbols produced will work correctly on the display and in a PostScript file. See the article Using Greek Symbols for additional information. |
cgWINDOW_GETDEFS | |
| This routine allows the user to get global default values for configuring cgWindow. |
cgWINDOW_SETDEFS | |
| This routine allows the user to set global default values for configuring cgWindow. |
cgWINDOW | |||
| This command is a resizeable graphics
window for displaying IDL graphics commands. In addition to resizing the graphics window, this command can create
BMP, GIF, JPEG, PNG, TIFF raster files, as well as true PostScript output. This command is invoked automatically by setting
the Window keyword on Coyote Graphics routines.
If ImageMagick is available on your machine, you will have the additional option of making raster image
files of the window contents directly from PostScript files. This completely eliminates any concern for
poor quality fonts in raster file output.
The cgWindow program can accept multiple graphics commands. Commands can be added, deleted, replaced, and listed. Multiple cgWindow programs can be opened at once, and you have easy access to the commands in any graphics window. Here is an example of how to display a filled contour plot with a color bar.
IDL> cgLoadCT, 4, /Brewer, /Reverse, NColors=12, Bottom=1
IDL> cgWindow, 'cgContour', cgDemoData(2), NLevels=12, /Fill, C_Colors=Indgen(12)+1, $
Position=[0.1,0.1,0.9,0.75]
IDL> cgWindow, 'cgContour', cgDemoData(2), Color='Charcoal', NLevels=12, /Overplot, /AddCmd
IDL> cgWindow, 'cgColorbar', Divisions=12, Range=[Min(data), Max(data)], NColors=12, $
Bottom=1, XMinor=0, XTicklen=1.0, /AddCmd
If used with Coyote Graphics routines (by setting the WINDOW keyword), cgWindow can be used in exactly the same way normal IDL graphics windows are used. That is to say, resizeable, smart graphics windows are available for all IDL users. |
![]()
Version of IDL used to prepare this article: IDL 7.0.1.
![]()
![]()






