Table of Contents | Color legend viewport layer | Up
Prev | Viewport layers | Next

#### Color legend viewport layer

This viewport layer renders the color scale associated with a Color coding modifier into the picture. The color legend allows a viewer to translate the colors in the picture into corresponding numeric values.

The color legend layer will render the color map only if is linked to a source modifier, which is the Color coding modifier in the current data pipeline from which the color legend layer adopts the color map and numeric range of values. When you first insert the color legend layer into a viewport, it gets automatically linked to the first Color coding modifier in the current data pipeline. You may have to pick the right color coding modifier manually in case there are multiple such modifiers in your pipeline or if you insert the modifier after you've already created the color legend layer.

The parameters of the color legend layer allow you control the size and the positioning of the color map in the rendered picture. By default, the legend will be labeled with the name of the selected input property that was used to produce the coloring and the minimum and maximum value of the numeric range set in the Color coding modifier. You can override these defaults by entering text into the Custom title and Custom label fields.

The text presentation of the numeric interval range is controlled by the format specification string. You have the choice between decimal notation (`%f`), exponential notation (`%e`) and an automatic mode (`%g`), which chooses the best representation depending on the value. Furthermore, the format string allows you to control the output precision, i.e. the number of digits that appear after the decimal point. Use `"%.2f"`, for example, to always show two digits after the decimal point. The format string must follow the standard convention of the printf() C function. Futhermore, it is possible to include a physical unit in the format string, e.g. `"%g eV"`.

##### See also

`ColorLegendOverlay` (Python API) pro

Prev | Up | Next
Viewport layers | Table of Contents | Coordinate tripod viewport layer