require PlotThemes v1
This commit is contained in:
parent
a3fc47a7de
commit
0458c18c13
@ -39,7 +39,7 @@ GeometryTypes = "0.7"
|
|||||||
JSON = "0.21"
|
JSON = "0.21"
|
||||||
Measures = "0.3"
|
Measures = "0.3"
|
||||||
NaNMath = "0.3"
|
NaNMath = "0.3"
|
||||||
PlotThemes = "0.2, 1"
|
PlotThemes = "1"
|
||||||
PlotUtils = "0.6.1"
|
PlotUtils = "0.6.1"
|
||||||
RecipesBase = "0.6, 0.7"
|
RecipesBase = "0.6, 0.7"
|
||||||
Reexport = "0.2"
|
Reexport = "0.2"
|
||||||
|
|||||||
@ -13,7 +13,6 @@ function _theme(s::Symbol, defaults::KW; kw...)
|
|||||||
reset_defaults()
|
reset_defaults()
|
||||||
|
|
||||||
# Set the theme's gradient as default
|
# Set the theme's gradient as default
|
||||||
fix_colorgradient!(defaults)
|
|
||||||
if haskey(defaults, :colorgradient)
|
if haskey(defaults, :colorgradient)
|
||||||
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))
|
||||||
@ -41,13 +40,6 @@ function _theme(s::Symbol, defaults::KW; kw...)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
# be compatible with old PlotThemes specifying the colorgradient with `:gradient`
|
|
||||||
function fix_colorgradient!(defaults)
|
|
||||||
if haskey(defaults, :gradient) && !haskey(defaults, :colorgradient)
|
|
||||||
defaults[:colorgradient] = pop!(defaults, :gradient)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@deprecate set_theme(s) theme(s)
|
@deprecate set_theme(s) theme(s)
|
||||||
|
|
||||||
@userplot ShowTheme
|
@userplot ShowTheme
|
||||||
@ -65,7 +57,6 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
|
|||||||
defaults = PlotThemes._themes[thm].defaults
|
defaults = PlotThemes._themes[thm].defaults
|
||||||
|
|
||||||
# get the gradient
|
# get the gradient
|
||||||
fix_colorgradient!(defaults)
|
|
||||||
gradient_colors = get(defaults, :colorgradient, cgrad(:inferno).colors)
|
gradient_colors = get(defaults, :colorgradient, cgrad(:inferno).colors)
|
||||||
colorgradient = cgrad(cfunc.(RGB.(gradient_colors)))
|
colorgradient = cgrad(cfunc.(RGB.(gradient_colors)))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user