require PlotThemes v1

This commit is contained in:
Daniel Schwabeneder 2019-11-29 16:27:57 +01:00
parent a3fc47a7de
commit 0458c18c13
2 changed files with 1 additions and 10 deletions

View File

@ -39,7 +39,7 @@ GeometryTypes = "0.7"
JSON = "0.21"
Measures = "0.3"
NaNMath = "0.3"
PlotThemes = "0.2, 1"
PlotThemes = "1"
PlotUtils = "0.6.1"
RecipesBase = "0.6, 0.7"
Reexport = "0.2"

View File

@ -13,7 +13,6 @@ function _theme(s::Symbol, defaults::KW; kw...)
reset_defaults()
# Set the theme's gradient as default
fix_colorgradient!(defaults)
if haskey(defaults, :colorgradient)
PlotUtils.clibrary(:misc)
PlotUtils.default_cgrad(default = :sequential, sequential = PlotThemes.gradient_name(s))
@ -41,13 +40,6 @@ function _theme(s::Symbol, defaults::KW; kw...)
return
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)
@userplot ShowTheme
@ -65,7 +57,6 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
defaults = PlotThemes._themes[thm].defaults
# get the gradient
fix_colorgradient!(defaults)
gradient_colors = get(defaults, :colorgradient, cgrad(:inferno).colors)
colorgradient = cgrad(cfunc.(RGB.(gradient_colors)))