Colors · Plots (original) (raw)

There are many color attributes, for lines, fills, markers, backgrounds, and foregrounds. Many colors follow a hierarchy... linecolor gets its value from seriescolor, for example, unless you override the value. This allows for you to simply set precisely what you want, without lots of boilerplate.

Color attributes will accept many different types:

In addition, there is an extensive facility for selecting and generating color maps/gradients.

Color names

The supported color names is the union of X11's and SVG's. They are defined in the Colors.jl ,like blue, blue2, blue3, ...etc.


Series Colors

For series, there are a few attributes to know:

seriescolor defaults to :auto, and gets assigned a color from the color_palette based on its index in the subplot. By default, the other colors :match. (See the table below)

In general, color gradients can be set by *color, and the corresponding color values to look up in the gradients by *_z.

This color... matches this color...
linecolor seriescolor
fillcolor seriescolor
markercolor seriescolor
markerstrokecolor foreground_color_subplot

each of these attributes have a corresponding alpha override: seriesalpha, linealpha, fillalpha, markeralpha, and markerstrokealpha. They are optional, and you can still give alpha information as part of an Colors.RGBA.

In some contexts, and when the user hasn't set a value, the linecolor or markerstrokecolor may be overridden.


Foreground/Background

Foreground and background colors work similarly:

This color... matches this color...
background_color_outside background_color
background_color_subplot background_color
background_color_legend background_color_subplot
background_color_inside background_color_subplot
foreground_color_subplot foreground_color
foreground_color_legend foreground_color_subplot
foreground_color_grid foreground_color_subplot
foreground_color_title foreground_color_subplot
foreground_color_axis foreground_color_subplot
foreground_color_border foreground_color_subplot
foreground_color_guide foreground_color_subplot
foreground_color_text foreground_color_subplot

Misc