Colorschemes
Plots supports all colorschemes from ColorSchemes.jl. They can be used as a gradient or as a palette and are passed as a symbol holding their name to cgrad or palette.
plot(
[x -> sin(x - a) for a in range(0, π / 2, length = 5)], 0, 2π;
palette = :Dark2_5,
)function f(x, y)
r = sqrt(x^2 + y^2)
return cos(r) / (1 + r)
end
x = range(0, 2π, length = 30)
heatmap(x, x, f, c = :thermal)ColorPalette
Plots chooses colors for series automatically from the palette passed to the color_palette attribute. The attribute accepts symbols of colorscheme names or ColorPalette objects. Color palettes can be constructed with palette(cs, [n]) where cs can be a Symbol, a vector of colors, a ColorScheme, ColorPalette or ColorGradient. The optional argument n decides how many colors to choose from cs.
palette(:tab10)palette([:purple, :green], 7)ColorGradient
For heatmap, surface, contour or line_z, marker_z and line_z Plots.jl chooses colors from a ColorGradient. If not specified, the default ColorGradient :inferno is used. A different gradient can be selected by passing a symbol for a colorscheme name to the seriescolor attribute. For more detailed configuration, the color attributes also accept a ColorGradient object. Color gradients can be constructed with
cgrad(cs, [z], alpha = nothing, rev = false, scale = nothing, categorical = nothing)where cs can be a Symbol, a vector of colors, a ColorScheme, ColorPalette or ColorGradient.
cgrad(:acton)You can pass a vector of values between 0 and 1 as second argument to specify positions of color transitions.
cgrad([:orange, :blue], [0.1, 0.3, 0.8])With rev = true the colorscheme colors are reversed.
cgrad(:thermal, rev = true)Setting categorical = true returns a CategoricalColorGradient that only chooses from a discrete set of colors without interpolating continuously. The optional second argument determines how many colors to choose from the colorscheme. They are distributed uniformly along the colorscheme colors.
cgrad(:matter, 5, categorical = true)Categorical gradients also accept a vector for positions of color transitions and can be reversed.
cgrad(:matter, [0.1, 0.3, 0.8], rev = true, categorical = true)The distribution of color selection can be scaled with the scale keyword argument which accepts :log, :log10, :ln, :log2, :exp or a function to be applied on the color position values between 0 and 1.
cgrad(:roma, scale = :log)Categorical gradients can also be scaled.
cgrad(:roma, 10, categorical = true, scale = :exp)Pre-defined ColorSchemes
misc
These colorschemes are not defined or provide different colors in ColorSchemes.jl They are kept for compatibility with Plots behavior before v1.1.0.
| Name | Palette | Gradient |
|---|---|---|
| :default | ||
| :blues | ||
| :bluesreds | ||
| :darkrainbow | ||
| :darktest | ||
| :grays | ||
| :greens | ||
| :heat | ||
| :lightrainbow | ||
| :lighttest | ||
| :rainbow | ||
| :reds | ||
| :redsblues |
The following colorschemes are defined by ColorSchemes.jl.
cmocean
| Name | Palette | Gradient |
|---|---|---|
| :algae | ||
| :amp | ||
| :balance | ||
| :curl | ||
| :deep | ||
| :delta | ||
| :dense | ||
| :diff | ||
| :grays | ||
| :haline | ||
| :ice | ||
| :matter | ||
| :oxy | ||
| :phase | ||
| :rain | ||
| :solar | ||
| :speed | ||
| :tarn | ||
| :tempo | ||
| :thermal | ||
| :topo | ||
| :turbid |
scientific
| Name | Palette | Gradient |
|---|---|---|
| :acton | ||
| :acton10 | ||
| :acton100 | ||
| :acton25 | ||
| :acton50 | ||
| :actonS | ||
| :bam | ||
| :bam10 | ||
| :bam100 | ||
| :bam25 | ||
| :bam50 | ||
| :bamO | ||
| :bamO10 | ||
| :bamO100 | ||
| :bamO25 | ||
| :bamO50 | ||
| :bamako | ||
| :bamako10 | ||
| :bamako100 | ||
| :bamako25 | ||
| :bamako50 | ||
| :bamakoS | ||
| :batlow | ||
| :batlow10 | ||
| :batlow100 | ||
| :batlow25 | ||
| :batlow50 | ||
| :batlowK | ||
| :batlowK10 | ||
| :batlowK100 | ||
| :batlowK25 | ||
| :batlowK50 | ||
| :batlowKS | ||
| :batlowS | ||
| :batlowW | ||
| :batlowW10 | ||
| :batlowW100 | ||
| :batlowW25 | ||
| :batlowW50 | ||
| :batlowWS | ||
| :berlin | ||
| :berlin10 | ||
| :berlin100 | ||
| :berlin25 | ||
| :berlin50 | ||
| :bilbao | ||
| :bilbao10 | ||
| :bilbao100 | ||
| :bilbao25 | ||
| :bilbao50 | ||
| :bilbaoS | ||
| :broc | ||
| :broc10 | ||
| :broc100 | ||
| :broc25 | ||
| :broc50 | ||
| :brocO | ||
| :brocO10 | ||
| :brocO100 | ||
| :brocO25 | ||
| :brocO50 | ||
| :buda | ||
| :buda10 | ||
| :buda100 | ||
| :buda25 | ||
| :buda50 | ||
| :budaS | ||
| :bukavu | ||
| :bukavu10 | ||
| :bukavu100 | ||
| :bukavu25 | ||
| :bukavu50 | ||
| :cork | ||
| :cork10 | ||
| :cork100 | ||
| :cork25 | ||
| :cork50 | ||
| :corkO | ||
| :corkO10 | ||
| :corkO100 | ||
| :corkO25 | ||
| :corkO50 | ||
| :davos | ||
| :davos10 | ||
| :davos100 | ||
| :davos25 | ||
| :davos50 | ||
| :davosS | ||
| :devon | ||
| :devon10 | ||
| :devon100 | ||
| :devon25 | ||
| :devon50 | ||
| :devonS | ||
| :fes | ||
| :fes10 | ||
| :fes100 | ||
| :fes25 | ||
| :fes50 | ||
| :glasgow | ||
| :glasgow10 | ||
| :glasgow100 | ||
| :glasgow25 | ||
| :glasgow50 | ||
| :glasgowS | ||
| :grayC | ||
| :grayC10 | ||
| :grayC100 | ||
| :grayC25 | ||
| :grayC50 | ||
| :grayCS | ||
| :hawaii | ||
| :hawaii10 | ||
| :hawaii100 | ||
| :hawaii25 | ||
| :hawaii50 | ||
| :hawaiiS | ||
| :imola | ||
| :imola10 | ||
| :imola100 | ||
| :imola25 | ||
| :imola50 | ||
| :imolaS | ||
| :lajolla | ||
| :lajolla10 | ||
| :lajolla100 | ||
| :lajolla25 | ||
| :lajolla50 | ||
| :lajollaS | ||
| :lapaz | ||
| :lapaz10 | ||
| :lapaz100 | ||
| :lapaz25 | ||
| :lapaz50 | ||
| :lapazS | ||
| :lipari | ||
| :lipari10 | ||
| :lipari100 | ||
| :lipari25 | ||
| :lipari50 | ||
| :lipariS | ||
| :lisbon | ||
| :lisbon10 | ||
| :lisbon100 | ||
| :lisbon25 | ||
| :lisbon50 | ||
| :managua | ||
| :managua10 | ||
| :managua100 | ||
| :managua25 | ||
| :managua50 | ||
| :navia | ||
| :navia10 | ||
| :navia100 | ||
| :navia25 | ||
| :navia50 | ||
| :naviaS | ||
| :nuuk | ||
| :nuuk10 | ||
| :nuuk100 | ||
| :nuuk25 | ||
| :nuuk50 | ||
| :nuukS | ||
| :oleron | ||
| :oleron10 | ||
| :oleron100 | ||
| :oleron25 | ||
| :oleron50 | ||
| :oslo | ||
| :oslo10 | ||
| :oslo100 | ||
| :oslo25 | ||
| :oslo50 | ||
| :osloS | ||
| :roma | ||
| :roma10 | ||
| :roma100 | ||
| :roma25 | ||
| :roma50 | ||
| :romaO | ||
| :romaO10 | ||
| :romaO100 | ||
| :romaO25 | ||
| :romaO50 | ||
| :tofino | ||
| :tofino10 | ||
| :tofino100 | ||
| :tofino25 | ||
| :tofino50 | ||
| :tokyo | ||
| :tokyo10 | ||
| :tokyo100 | ||
| :tokyo25 | ||
| :tokyo50 | ||
| :tokyoS | ||
| :turku | ||
| :turku10 | ||
| :turku100 | ||
| :turku25 | ||
| :turku50 | ||
| :turkuS | ||
| :vanimo | ||
| :vanimo10 | ||
| :vanimo100 | ||
| :vanimo25 | ||
| :vanimo50 | ||
| :vik | ||
| :vik10 | ||
| :vik100 | ||
| :vik25 | ||
| :vik50 | ||
| :vikO | ||
| :vikO10 | ||
| :vikO100 | ||
| :vikO25 | ||
| :vikO50 |
matplotlib
| Name | Palette | Gradient |
|---|---|---|
| :Wistia | ||
| :autumn1 | ||
| :binary | ||
| :bone | ||
| :bone_1 | ||
| :brg | ||
| :bwr | ||
| :cool | ||
| :coolwarm | ||
| :copper | ||
| :flag | ||
| :gist_earth | ||
| :gist_gray | ||
| :gist_heat | ||
| :gist_ncar | ||
| :gist_rainbow | ||
| :gist_stern | ||
| :gist_yarg | ||
| :gray1 | ||
| :hot | ||
| :hsv | ||
| :inferno | ||
| :jet1 | ||
| :magma | ||
| :nipy_spectral | ||
| :pink | ||
| :plasma | ||
| :prism | ||
| :seismic | ||
| :spring | ||
| :summer | ||
| :tab10 | ||
| :tab20 | ||
| :tab20b | ||
| :tab20c | ||
| :terrain | ||
| :twilight | ||
| :viridis | ||
| :winter |
colorbrewer
| Name | Palette | Gradient |
|---|---|---|
| :Accent_3 | ||
| :Accent_4 | ||
| :Accent_5 | ||
| :Accent_6 | ||
| :Accent_7 | ||
| :Accent_8 | ||
| :Blues | ||
| :Blues_3 | ||
| :Blues_4 | ||
| :Blues_5 | ||
| :Blues_6 | ||
| :Blues_7 | ||
| :Blues_8 | ||
| :Blues_9 | ||
| :BrBG_10 | ||
| :BrBG_11 | ||
| :BrBG_3 | ||
| :BrBG_4 | ||
| :BrBG_5 | ||
| :BrBG_6 | ||
| :BrBG_7 | ||
| :BrBG_8 | ||
| :BrBG_9 | ||
| :BrBg | ||
| :BuGn | ||
| :BuGn_3 | ||
| :BuGn_4 | ||
| :BuGn_5 | ||
| :BuGn_6 | ||
| :BuGn_7 | ||
| :BuGn_8 | ||
| :BuGn_9 | ||
| :BuPu | ||
| :BuPu_3 | ||
| :BuPu_4 | ||
| :BuPu_5 | ||
| :BuPu_6 | ||
| :BuPu_7 | ||
| :BuPu_8 | ||
| :BuPu_9 | ||
| :Dark2_3 | ||
| :Dark2_4 | ||
| :Dark2_5 | ||
| :Dark2_6 | ||
| :Dark2_7 | ||
| :Dark2_8 | ||
| :GnBu | ||
| :GnBu_3 | ||
| :GnBu_4 | ||
| :GnBu_5 | ||
| :GnBu_6 | ||
| :GnBu_7 | ||
| :GnBu_8 | ||
| :GnBu_9 | ||
| :Greens | ||
| :Greens_3 | ||
| :Greens_4 | ||
| :Greens_5 | ||
| :Greens_6 | ||
| :Greens_7 | ||
| :Greens_8 | ||
| :Greens_9 | ||
| :Greys | ||
| :Greys_3 | ||
| :Greys_4 | ||
| :Greys_5 | ||
| :Greys_6 | ||
| :Greys_7 | ||
| :Greys_8 | ||
| :Greys_9 | ||
| :OrRd | ||
| :OrRd_3 | ||
| :OrRd_4 | ||
| :OrRd_5 | ||
| :OrRd_6 | ||
| :OrRd_7 | ||
| :OrRd_8 | ||
| :OrRd_9 | ||
| :Oranges | ||
| :Oranges_3 | ||
| :Oranges_4 | ||
| :Oranges_5 | ||
| :Oranges_6 | ||
| :Oranges_7 | ||
| :Oranges_8 | ||
| :Oranges_9 | ||
| :PRGn | ||
| :PRGn_10 | ||
| :PRGn_11 | ||
| :PRGn_3 | ||
| :PRGn_4 | ||
| :PRGn_5 | ||
| :PRGn_6 | ||
| :PRGn_7 | ||
| :PRGn_8 | ||
| :PRGn_9 | ||
| :Paired_10 | ||
| :Paired_11 | ||
| :Paired_12 | ||
| :Paired_3 | ||
| :Paired_4 | ||
| :Paired_5 | ||
| :Paired_6 | ||
| :Paired_7 | ||
| :Paired_8 | ||
| :Paired_9 | ||
| :Pastel1_3 | ||
| :Pastel1_4 | ||
| :Pastel1_5 | ||
| :Pastel1_6 | ||
| :Pastel1_7 | ||
| :Pastel1_8 | ||
| :Pastel1_9 | ||
| :Pastel2_3 | ||
| :Pastel2_4 | ||
| :Pastel2_5 | ||
| :Pastel2_6 | ||
| :Pastel2_7 | ||
| :Pastel2_8 | ||
| :PiYG | ||
| :PiYG_10 | ||
| :PiYG_11 | ||
| :PiYG_3 | ||
| :PiYG_4 | ||
| :PiYG_5 | ||
| :PiYG_6 | ||
| :PiYG_7 | ||
| :PiYG_8 | ||
| :PiYG_9 | ||
| :PuBu | ||
| :PuBuGn | ||
| :PuBuGn_3 | ||
| :PuBuGn_4 | ||
| :PuBuGn_5 | ||
| :PuBuGn_6 | ||
| :PuBuGn_7 | ||
| :PuBuGn_8 | ||
| :PuBuGn_9 | ||
| :PuBu_3 | ||
| :PuBu_4 | ||
| :PuBu_5 | ||
| :PuBu_6 | ||
| :PuBu_7 | ||
| :PuBu_8 | ||
| :PuBu_9 | ||
| :PuOr | ||
| :PuOr_10 | ||
| :PuOr_11 | ||
| :PuOr_3 | ||
| :PuOr_4 | ||
| :PuOr_5 | ||
| :PuOr_6 | ||
| :PuOr_7 | ||
| :PuOr_8 | ||
| :PuOr_9 | ||
| :PuRd | ||
| :PuRd_3 | ||
| :PuRd_4 | ||
| :PuRd_5 | ||
| :PuRd_6 | ||
| :PuRd_7 | ||
| :PuRd_8 | ||
| :PuRd_9 | ||
| :Purples | ||
| :Purples_3 | ||
| :Purples_4 | ||
| :Purples_5 | ||
| :Purples_6 | ||
| :Purples_7 | ||
| :Purples_8 | ||
| :Purples_9 | ||
| :RdBu | ||
| :RdBu_10 | ||
| :RdBu_11 | ||
| :RdBu_3 | ||
| :RdBu_4 | ||
| :RdBu_5 | ||
| :RdBu_6 | ||
| :RdBu_7 | ||
| :RdBu_8 | ||
| :RdBu_9 | ||
| :RdGy | ||
| :RdGy_10 | ||
| :RdGy_11 | ||
| :RdGy_3 | ||
| :RdGy_4 | ||
| :RdGy_5 | ||
| :RdGy_6 | ||
| :RdGy_7 | ||
| :RdGy_8 | ||
| :RdGy_9 | ||
| :RdPu | ||
| :RdPu_3 | ||
| :RdPu_4 | ||
| :RdPu_5 | ||
| :RdPu_6 | ||
| :RdPu_7 | ||
| :RdPu_8 | ||
| :RdPu_9 | ||
| :RdYlBu | ||
| :RdYlBu_10 | ||
| :RdYlBu_11 | ||
| :RdYlBu_3 | ||
| :RdYlBu_4 | ||
| :RdYlBu_5 | ||
| :RdYlBu_6 | ||
| :RdYlBu_7 | ||
| :RdYlBu_8 | ||
| :RdYlBu_9 | ||
| :RdYlGn | ||
| :RdYlGn_10 | ||
| :RdYlGn_11 | ||
| :RdYlGn_3 | ||
| :RdYlGn_4 | ||
| :RdYlGn_5 | ||
| :RdYlGn_6 | ||
| :RdYlGn_7 | ||
| :RdYlGn_8 | ||
| :RdYlGn_9 | ||
| :Reds | ||
| :Reds_3 | ||
| :Reds_4 | ||
| :Reds_5 | ||
| :Reds_6 | ||
| :Reds_7 | ||
| :Reds_8 | ||
| :Reds_9 | ||
| :Set1_3 | ||
| :Set1_4 | ||
| :Set1_5 | ||
| :Set1_6 | ||
| :Set1_7 | ||
| :Set1_8 | ||
| :Set1_9 | ||
| :Set2_3 | ||
| :Set2_4 | ||
| :Set2_5 | ||
| :Set2_6 | ||
| :Set2_7 | ||
| :Set2_8 | ||
| :Set3_10 | ||
| :Set3_11 | ||
| :Set3_12 | ||
| :Set3_3 | ||
| :Set3_4 | ||
| :Set3_5 | ||
| :Set3_6 | ||
| :Set3_7 | ||
| :Set3_8 | ||
| :Set3_9 | ||
| :Spectral | ||
| :Spectral_10 | ||
| :Spectral_11 | ||
| :Spectral_3 | ||
| :Spectral_4 | ||
| :Spectral_5 | ||
| :Spectral_6 | ||
| :Spectral_7 | ||
| :Spectral_8 | ||
| :Spectral_9 | ||
| :YlGn | ||
| :YlGnBu | ||
| :YlGnBu_3 |