Color bars are visual screen (2D) object nodes, which are used to visualize the colormap for those objects which use colormaps for coloring faces. Examples are surface and contour plots. Which colormap is visualized in a color bar is determined by the location of a color bar in the scene graph. The color bar uses that plot object, which is the next parent on the way up to the root which provides a colormap. Therefore, most the time, color bars are simply added to the Children collection of corresponding plot objects. In order to display a color bar for a surface, one simply adds the color bar object to the surface node:
Interactivity and Color Bars
If the renderer supports user interaction, color bars can be moved with the mouse. A North-South-West-East arrows cursor indicates that option when hovering over the legends background area.
In order to prevent the user from moving a color bar interactively, the ScreenRect.Movable property of the base class can be set to false.