ChimeraX docs icon

Tool: Color Key

Coulombic ESP flat lighting
see image how-to

Color Key creates a legend or key to show the value-color correspondences in a figure, such as from:

The Color Key dialog can be opened from the Depiction section of the Tools menu and manipulated like other panels (more...). It can also be started by clicking the Right Mouse toolbar icon or the Key button in Surface Color. Starting the tool automatically generates an initial color key according to the current settings and enables redrawing and moving it with the mouse. The color key can be controlled with the dialog, mouse, and/or the key command. The command also has a showTool option to raise the dialog.

To create a title for the key (e.g., “electrostatic potential” as shown in the image), use 2dlabels.

When a color-by-value command is run interactively (in gui mode and not via a script), the key option of that command can be used to start Color Key with the corresponding colors and values already set. For example, see the instructions for the last image in Coloring by Sequence Conservation, pt. 3. See also: Render by Attribute, Scale Bar, mousemode , making images

It is usually best to adjust the Number of colors/labels (default 3) as needed before making other changes.

The color/label pairs from bottom to top in the dialog will be arranged from bottom to top in a vertical key and from left to right in a horizontal key. Label text can be entered directly or pasted, potentially including symbols.

Clicking Reverse repopulates the color/label values in the reverse of the current order. Blend colors indicates whether to draw the color bar as a continuous gradient (default), as opposed to distinct colors only. The colors can be changed collectively by choosing a named palette (default blue-white-red
) from the pulldown menu and clicking Apply, or individually by clicking the color well and using the system color editor.

The Size and lower-left corner Position values can be edited directly, and are expressed in fractional coordinates 0.0-1.0 where 1.0 represents the full width or height of the graphics window and 1.0,1.0 its top right corner. However, it is usually easiest to set the location and size interactively with the mouse according to Adjust key with [button] mouse button (on by default; sets the color key mouse mode). Clicking with the assigned button or its trackpad equivalent sets the location, and dragging sets the size. A color key can be vertical (taller than wide) or horizontal (wider than tall). A previously created color key can be moved by grabbing near its center and dragging, but clicking anywhere else will delete the color key and start over. If width and height are both extremely small, such as from clicking without dragging, the key is not drawn. The color key is created as a model, and only one color key can exist at a time, Further options are in tabbed sections:

Clicking Close hides the dialog without deleting the color key model, whereas Delete/Close both deletes the color key model (forgetting the current settings) and closes the dialog. Clicking Help shows this page in the Help Viewer.



Tick Marks

Tick mark color is the same as border color.

UCSF Resource for Biocomputing, Visualization, and Informatics / March 2023