add new heme() function
This commit is contained in:
parent
863ec08681
commit
899afd625a
@ -4,43 +4,53 @@
|
|||||||
Specify the colour theme for plots.
|
Specify the colour theme for plots.
|
||||||
"""
|
"""
|
||||||
function theme(s::Symbol; kw...)
|
function theme(s::Symbol; kw...)
|
||||||
# reset?
|
defaults = merge(_initial_defaults..., s.defaults, kw)
|
||||||
if s == :none || s == :default
|
if haskey(s.defaults, :gradient)
|
||||||
PlotUtils.clibrary(:Plots)
|
|
||||||
PlotUtils.default_cgrad(default = :sequential, sequential = :inferno)
|
|
||||||
default(;
|
|
||||||
bg = :white,
|
|
||||||
bglegend = :match,
|
|
||||||
bginside = :match,
|
|
||||||
bgoutside = :match,
|
|
||||||
fg = :auto,
|
|
||||||
fglegend = :match,
|
|
||||||
fggrid = :match,
|
|
||||||
fgaxis = :match,
|
|
||||||
fgtext = :match,
|
|
||||||
fgborder = :match,
|
|
||||||
fgguide = :match,
|
|
||||||
palette = :auto
|
|
||||||
)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
# update the default gradient and other defaults
|
|
||||||
thm = PlotThemes._themes[s]
|
|
||||||
if thm.gradient != nothing
|
|
||||||
PlotUtils.clibrary(:misc)
|
PlotUtils.clibrary(:misc)
|
||||||
PlotUtils.default_cgrad(default = :sequential, sequential = PlotThemes.gradient_name(s))
|
PlotUtils.default_cgrad(default = :sequential, sequential = PlotThemes.gradient_name(s))
|
||||||
end
|
end
|
||||||
default(;
|
default(; defaults...)
|
||||||
bg = thm.bg_secondary,
|
return
|
||||||
bginside = thm.bg_primary,
|
|
||||||
fg = thm.lines,
|
|
||||||
fgtext = thm.text,
|
|
||||||
fgguide = thm.text,
|
|
||||||
fglegend = thm.text,
|
|
||||||
palette = thm.palette,
|
|
||||||
kw...
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# function theme(s::Symbol; kw...)
|
||||||
|
# # reset?
|
||||||
|
# if s == :none || s == :default
|
||||||
|
# PlotUtils.clibrary(:Plots)
|
||||||
|
# PlotUtils.default_cgrad(default = :sequential, sequential = :inferno)
|
||||||
|
# default(;
|
||||||
|
# bg = :white,
|
||||||
|
# bglegend = :match,
|
||||||
|
# bginside = :match,
|
||||||
|
# bgoutside = :match,
|
||||||
|
# fg = :auto,
|
||||||
|
# fglegend = :match,
|
||||||
|
# fggrid = :match,
|
||||||
|
# fgaxis = :match,
|
||||||
|
# fgtext = :match,
|
||||||
|
# fgborder = :match,
|
||||||
|
# fgguide = :match,
|
||||||
|
# palette = :auto
|
||||||
|
# )
|
||||||
|
# return
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# # update the default gradient and other defaults
|
||||||
|
# thm = PlotThemes._themes[s]
|
||||||
|
# if thm.gradient != nothing
|
||||||
|
# PlotUtils.clibrary(:misc)
|
||||||
|
# PlotUtils.default_cgrad(default = :sequential, sequential = PlotThemes.gradient_name(s))
|
||||||
|
# end
|
||||||
|
# default(;
|
||||||
|
# bg = thm.bg_secondary,
|
||||||
|
# bginside = thm.bg_primary,
|
||||||
|
# fg = thm.lines,
|
||||||
|
# fgtext = thm.text,
|
||||||
|
# fgguide = thm.text,
|
||||||
|
# fglegend = thm.text,
|
||||||
|
# palette = thm.palette,
|
||||||
|
# kw...
|
||||||
|
# )
|
||||||
|
# end
|
||||||
|
|
||||||
@deprecate set_theme(s) theme(s)
|
@deprecate set_theme(s) theme(s)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user