VCOLORBAR
vcolorbar__define.pro
The purpose of this program is to create a vertical colorbar object to be used in conjunction with other IDL 5 graphics objects.
FANNING SOFTWARE CONSULTING David Fanning, Ph.D. 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/
IDL Object Graphics.
thisColorBar = Obj_New('VColorBar')
None.
COLOR: A three-element array representing the RGB values of a color for the colorbar axes and annotation. The default value is white: [255,255,255]. NAME: The name associated with this object. NCOLORS: The number of colors associated with the colorbar. The default is 256. MAJOR: The number of major tick divisions on the colorbar axes. The default is 5. MINOR: The number of minor tick marks on the colorbar axes. The default is 4. PALETTE: A palette object for the colorbar. The default palette is a gray-scale palette object. POSITION: A four-element array specifying the position of the colorbar in the arbitary coordinate system of the viewplane rectangle. The default position is [0.90, 0.10, 0.95, 0.90]. RANGE: The range associated with the colorbar axis. The default is [0, NCOLORS]. TITLE: A string containing a title for the colorbar axis annotation. The default is a null string.
Clamp (Procedure): Given a two-element array in the data range of the colorbar, the colorbar image is clamped to this range. In other words, the range of colors is clamped to the specified range. Values above or below the range in the colorbar are set to the minimum and maximum range values, respectively. GetProperty (Procedure): Returns colorbar properties in keyword parameters as defined for the INIT method. Keywords allowed are: COLOR MAJOR MINOR NAME PALETTE POSITION RANGE TITLE TRANSFORM SetProperty (Procedure): Sets colorbar properties in keyword parameters as defined for the INIT method. Keywords allowed are: COLOR NAME MAJOR MINOR PALETTE POSITION RANGE TITLE TRANSFORM
A VCOLORBAR object is created. The colorbar INHERITS IDLgrMODEL. Thus, all IDLgrMODEL methods and keywords can also be used. It is the model that is selected in a selection event, since the SELECT_TARGET keyword is set for the model.
To create a colorbar object and add it to a plot view object, type: thisColorBarObject = Obj_New('VColorBar') plotView->Add, thisColorBarObject plotWindow->Draw, plotView
Written by David W. Fanning, 19 June 97. Changed the optional "colorbarmodel" parameter to an optional GETMODEL parameter. 26 June 97. DWF. Fixed bug in the way the color palette was assigned. 13 Aug 97. DWF. Added missing container object to self structure. 13 Aug 97. DWF. Removed image model, which was a workaround for broken 5.0 objects. 5 Oct 97. DWF Fixed cleanup procedure to clean up ALL objects. 12 Feb 98. DWF. Changed IDLgrContainer to IDL_Container to fix 5.1 problems. 20 May 98. DWF. Modified colorbar to INHERIT an IDLgrModel object. This allows me to add the colorbar to other models directly. 20 Sept 98. DWF. Added NAME keyword to give the colorbar a name. 20 Sept 98. DWF. Changed a reference to _Ref_Extra to _Extra. 27 Sept 98. DWF. Fixed bug when adding a text object via the TEXT keyword. 9 May 99. DWF. Fixed a bug with getting the text object via the TEXT keyword. 16 Aug 2000. DWF. Added the TRANSFORM keyword to GetProperty and SetProperty methods. 16 Aug 2000. DWF. Added RECOMPUTE_DIMENSIONS=2 to text objects. 16 Aug 2000. DWF. Added a polygon object around the image object. This allows rotation in 3D space. 16 Aug 2000. DWF. Removed TEXT keyword (which was never used) and fixed TITLE keyword. 8 Dec 2000. DWF. Added ENABLE_FORMATTING keyword to title objects. 22 October 2001. DWF. Added a CLAMP method. 18 November 2001. DWF. Forgot to pass extra keywords along to the text widget. As a result, you couldn't format tick labels, etc. Fixed this. Any keywords appropriate for IDLgrTick objects are now available. 26 June 2002. DWF. Fixed a problem with POSITION keyword in SetProperty method. 23 May 2003. DWF. Removed NORMALIZE from source code. 29 Nov 2005. DWF. Font sizes have changed. Now using a 12 point font. 6 May 2011. DWF. Changed FSC_Normalize to cgNormalize to reflect new name. 6 Feb 2013. DWF.