Graphics |
Colormap Colors and Fixed Colors
MATLAB maintains two categories of colors for each figure - colors that are defined in the colormap and colors that are fixed, which do not change when you change the colormap. These two categories are used in different ways.
Only surface, patch, and image objects use the colormap. MATLAB colors these objects based on the order the colors appear in the colormap.
Fixed colors are simply definitions of specific colors that MATLAB uses to color axis lines and labels and values you specify for object colors (i.e., the Color
, ColorOrder
, FaceColor
, EdgeColor
, MarkerFaceColor
, and MarkerEdgeColor
properties).
Defining Fixed Colors
When MATLAB creates a figure, it defines three fixed colors.
Creating an axes includes the colors defined by the axes ColorOrder
property in the fixed color list, since it is more efficient to predefine these colors.
axes get(gcf,'FixedColors') ans = 0.8000 0.8000 0.8000 0 0 0 1.0000 1.0000 1.0000 0 0 1.0000 0 0.5000 0 1.0000 0 0 0 0.7500 0.7500 0.7500 0 0.7500 0.7500 0.7500 0 0.2500 0.2500 0.2500
Any colors you define, for example,
also become part of the fixed color list. You can define as many fixed colors as you want without affecting the colors in the figure colormap. However, fixed colors occupy color table slots that MATLAB cannot use for the colormap.
Indexed Color Displays | Using a Large Number of Colors |