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(NAME) | cgrad(NAME) |
---|---|---|
:default | ||
:blues | ||
:bluesreds | ||
:cividis | ||
:darkrainbow | ||
:darktest | ||
:grays | ||
:greens | ||
:heat | ||
:lightrainbow | ||
:lighttest | ||
:rainbow | ||
:reds | ||
:redsblues |
The following colorschemes are defined by ColorSchemes.jl.
cmocean
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:algae | ||
:amp | ||
:balance | ||
:curl | ||
:deep | ||
:delta | ||
:dense | ||
:grays | ||
:haline | ||
:ice | ||
:matter | ||
:oxy | ||
:phase | ||
:solar | ||
:speed | ||
:tempo | ||
:thermal | ||
:turbid |
scientific
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:acton | ||
:bamako | ||
:batlow | ||
:berlin | ||
:bilbao | ||
:broc | ||
:brocO | ||
:buda | ||
:cork | ||
:corkO | ||
:davos | ||
:devon | ||
:grayC | ||
:hawaii | ||
:imola | ||
:lajolla | ||
:lapaz | ||
:lisbon | ||
:nuuk | ||
:oleron | ||
:oslo | ||
:roma | ||
:romaO | ||
:tofino | ||
:tokyo | ||
:turku | ||
:vik | ||
:vikO |
matplotlib
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
: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(NAME) | cgrad(NAME) |
---|---|---|
: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 | ||
:YlGnBu_4 | ||
:YlGnBu_5 | ||
:YlGnBu_6 | ||
:YlGnBu_7 | ||
:YlGnBu_8 | ||
:YlGnBu_9 | ||
:YlGn_3 | ||
:YlGn_4 | ||
:YlGn_5 | ||
:YlGn_6 | ||
:YlGn_7 | ||
:YlGn_8 | ||
:YlGn_9 | ||
:YlOrBr | ||
:YlOrBr_3 | ||
:YlOrBr_4 | ||
:YlOrBr_5 | ||
:YlOrBr_6 | ||
:YlOrBr_7 | ||
:YlOrBr_8 | ||
:YlOrBr_9 | ||
:YlOrRd | ||
:YlOrRd_3 | ||
:YlOrRd_4 | ||
:YlOrRd_5 | ||
:YlOrRd_6 | ||
:YlOrRd_7 | ||
:YlOrRd_8 | ||
:YlOrRd_9 |
gnuplot
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:afmhot | ||
:gnuplot | ||
:gnuplot2 | ||
:ocean | ||
:rainbow1 |
colorcet
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:cyclic_grey_15_85_c0_n256 | ||
:cyclic_grey_15_85_c0_n256_s25 | ||
:cyclic_mrybm_35_75_c68_n256 | ||
:cyclic_mrybm_35_75_c68_n256_s25 | ||
:cyclic_mygbm_30_95_c78_n256 | ||
:cyclic_mygbm_30_95_c78_n256_s25 | ||
:cyclic_protanopic_deuteranopic_bwyk_16_96_c31_n256 | ||
:cyclic_protanopic_deuteranopic_wywb_55_96_c33_n256 | ||
:cyclic_tritanopic_cwrk_40_100_c20_n256 | ||
:cyclic_tritanopic_wrwc_70_100_c20_n256 | ||
:cyclic_wrwbw_40_90_c42_n256 | ||
:cyclic_wrwbw_40_90_c42_n256_s25 | ||
:diverging_bkr_55_10_c35_n256 | ||
:diverging_bky_60_10_c30_n256 | ||
:diverging_bwg_20_95_c41_n256 | ||
:diverging_bwr_20_95_c54_n256 | ||
:diverging_bwr_40_95_c42_n256 | ||
:diverging_bwr_55_98_c37_n256 | ||
:diverging_cwm_80_100_c22_n256 | ||
:diverging_gkr_60_10_c40_n256 | ||
:diverging_gwr_55_95_c38_n256 | ||
:diverging_gwv_55_95_c39_n256 | ||
:diverging_isoluminant_cjm_75_c23_n256 | ||
:diverging_isoluminant_cjm_75_c24_n256 | ||
:diverging_isoluminant_cjo_70_c25_n256 | ||
:diverging_linear_bjr_30_55_c53_n256 | ||
:diverging_linear_bjy_30_90_c45_n256 | ||
:diverging_protanopic_deuteranopic_bwy_60_95_c32_n256 | ||
:diverging_rainbow_bgymr_45_85_c67_n256 | ||
:diverging_tritanopic_cwr_75_98_c20_n256 | ||
:glasbey_bw_minc_20_hue_150_280_n256 | ||
:glasbey_bw_minc_20_hue_330_100_n256 | ||
:glasbey_bw_minc_20_maxl_70_n256 | ||
:glasbey_bw_minc_20_minl_30_n256 | ||
:glasbey_bw_minc_20_n256 | ||
:glasbey_bw_n256 | ||
:glasbey_category10_n256 | ||
:glasbey_hv_n256 | ||
:isoluminant_cgo_70_c39_n256 | ||
:isoluminant_cgo_80_c38_n256 | ||
:isoluminant_cm_70_c39_n256 | ||
:linear_bgy_10_95_c74_n256 | ||
:linear_bgyw_15_100_c67_n256 | ||
:linear_bgyw_15_100_c68_n256 | ||
:linear_bgyw_20_98_c66_n256 | ||
:linear_blue_5_95_c73_n256 | ||
:linear_blue_95_50_c20_n256 | ||
:linear_bmw_5_95_c86_n256 | ||
:linear_bmw_5_95_c89_n256 | ||
:linear_bmy_10_95_c71_n256 | ||
:linear_bmy_10_95_c78_n256 | ||
:linear_gow_60_85_c27_n256 | ||
:linear_gow_65_90_c35_n256 | ||
:linear_green_5_95_c69_n256 | ||
:linear_grey_0_100_c0_n256 | ||
:linear_grey_10_95_c0_n256 | ||
:linear_kbc_5_95_c73_n256 | ||
:linear_kbgyw_5_98_c62_n256 | ||
:linear_kgy_5_95_c69_n256 | ||
:linear_kry_0_97_c73_n256 | ||
:linear_kry_5_95_c72_n256 | ||
:linear_kry_5_98_c75_n256 | ||
:linear_kryw_0_100_c71_n256 | ||
:linear_kryw_5_100_c64_n256 | ||
:linear_kryw_5_100_c67_n256 | ||
:linear_protanopic_deuteranopic_kbjyw_5_95_c25_n256 | ||
:linear_protanopic_deuteranopic_kbw_5_98_c40_n256 | ||
:linear_ternary_blue_0_44_c57_n256 | ||
:linear_ternary_green_0_46_c42_n256 | ||
:linear_ternary_red_0_50_c52_n256 | ||
:linear_tritanopic_krjcw_5_95_c24_n256 | ||
:linear_tritanopic_krjcw_5_98_c46_n256 | ||
:linear_wcmr_100_45_c42_n256 | ||
:linear_worb_100_25_c53_n256 | ||
:linear_wyor_100_45_c55_n256 | ||
:rainbow_bgyr_35_85_c72_n256 | ||
:rainbow_bgyr_35_85_c73_n256 | ||
:rainbow_bgyrm_35_85_c69_n256 | ||
:rainbow_bgyrm_35_85_c71_n256 |
seaborn
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:seaborn_bright | ||
:seaborn_bright6 | ||
:seaborn_colorblind | ||
:seaborn_colorblind6 | ||
:seaborn_dark | ||
:seaborn_dark6 | ||
:seaborn_deep | ||
:seaborn_deep6 | ||
:seaborn_icefire_gradient | ||
:seaborn_muted | ||
:seaborn_muted6 | ||
:seaborn_pastel | ||
:seaborn_pastel6 | ||
:seaborn_rocket_gradient |
general
NAME | palette(NAME) | cgrad(NAME) |
---|---|---|
:CMRmap | ||
:alpine | ||
:aquamarine | ||
:army | ||
:atlantic | ||
:auerbach | ||
:aurora | ||
:autumn | ||
:avocado | ||
:beach | ||
:blackbody | ||
:bluegreenyellow | ||
:bosch_garden | ||
:bosch_hell | ||
:botticelli | ||
:brass | ||
:browncyan | ||
:canaletto | ||
:candy | ||
:cezanne | ||
:cherry | ||
:cmyk | ||
:coffee | ||
:cubehelix | ||
:darkrainbow | ||
:darkterrain | ||
:deepsea | ||
:dracula | ||
:fall | ||
:fastie | ||
:fruitpunch | ||
:fuchsia | ||
:gold | ||
:grays1 | ||
:grayyellow | ||
:greenbrownterrain | ||
:greenpink | ||
:hokusai | ||
:holbein | ||
:island | ||
:jet | ||
:julia_colorscheme | ||
:klimt | ||
:lake | ||
:leonardo | ||
:lighttemperaturemap | ||
:lightterrain | ||
:mint | ||
:munch | ||
:neon | ||
:pastel | ||
:pearl | ||
:picasso | ||
:pigeon | ||
:plum | ||
:rainbow | ||
:redblue | ||
:redgreensplit | ||
:rembrandt | ||
:rose | ||
:rust | ||
:sandyterrain | ||
:sienna | ||
:southwest | ||
:starrynight | ||
:sun | ||
:sunset | ||
:temperaturemap | ||
:thermometer | ||
:turbo | ||
:valentine | ||
:vangogh | ||
:vanhelsing | ||
:vermeer | ||
:watermelon | ||
:websafe |