From eab4cfdf2d4b4c5efe7e5daf285b0be2303da77e Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Sun, 26 Feb 2017 17:23:43 +0100 Subject: [PATCH 1/4] allow color libraries to be used in PlotThemes --- src/themes.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/themes.jl b/src/themes.jl index 3429585a..feb665d6 100644 --- a/src/themes.jl +++ b/src/themes.jl @@ -2,7 +2,8 @@ function theme(s::Symbol; kw...) # reset? if s == :none || s == :default - PlotUtils._default_gradient[] = :inferno + PlotUtils.set_clibrary(:matplotlib) + PlotUtils.cgraddefaults(:inferno) default(; bg = :white, bglegend = :match, @@ -23,7 +24,8 @@ function theme(s::Symbol; kw...) # update the default gradient and other defaults thm = PlotThemes._themes[s] if thm.gradient != nothing - PlotUtils._default_gradient[] = PlotThemes.gradient_name(s) + PlotUtils.set_clibrary(:plotthemes) + PlotUtils.cgraddefaults(PlotThemes.gradient_name(s)) end default(; bg = thm.bg_secondary, From 6c51982793c48d9dc24e4757a880ec0f2dbe566e Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Sun, 26 Feb 2017 20:43:04 +0100 Subject: [PATCH 2/4] fix theme default --- src/themes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/themes.jl b/src/themes.jl index feb665d6..442e67d0 100644 --- a/src/themes.jl +++ b/src/themes.jl @@ -25,7 +25,7 @@ function theme(s::Symbol; kw...) thm = PlotThemes._themes[s] if thm.gradient != nothing PlotUtils.set_clibrary(:plotthemes) - PlotUtils.cgraddefaults(PlotThemes.gradient_name(s)) + PlotUtils.cgraddefaults(default = PlotThemes.gradient_name(s)) end default(; bg = thm.bg_secondary, From 5465479e5772b60d4a19c6eae191f9fa3908b498 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Mon, 27 Feb 2017 21:47:12 +0100 Subject: [PATCH 3/4] Put themes in Plots library --- src/themes.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/themes.jl b/src/themes.jl index 442e67d0..70ee50db 100644 --- a/src/themes.jl +++ b/src/themes.jl @@ -2,7 +2,7 @@ function theme(s::Symbol; kw...) # reset? if s == :none || s == :default - PlotUtils.set_clibrary(:matplotlib) + PlotUtils.set_clibrary(:Plots) PlotUtils.cgraddefaults(:inferno) default(; bg = :white, @@ -24,7 +24,7 @@ function theme(s::Symbol; kw...) # update the default gradient and other defaults thm = PlotThemes._themes[s] if thm.gradient != nothing - PlotUtils.set_clibrary(:plotthemes) + PlotUtils.set_clibrary(:Plots) PlotUtils.cgraddefaults(default = PlotThemes.gradient_name(s)) end default(; From 6b94bbac2d9031dd41b711794855b29f82ef16af Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Mon, 27 Feb 2017 21:52:22 +0100 Subject: [PATCH 4/4] updated function names --- src/themes.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/themes.jl b/src/themes.jl index 70ee50db..c069a251 100644 --- a/src/themes.jl +++ b/src/themes.jl @@ -2,8 +2,8 @@ function theme(s::Symbol; kw...) # reset? if s == :none || s == :default - PlotUtils.set_clibrary(:Plots) - PlotUtils.cgraddefaults(:inferno) + PlotUtils.clibrary(:Plots) + PlotUtils.default_cgrad(:inferno) default(; bg = :white, bglegend = :match, @@ -24,8 +24,8 @@ function theme(s::Symbol; kw...) # update the default gradient and other defaults thm = PlotThemes._themes[s] if thm.gradient != nothing - PlotUtils.set_clibrary(:Plots) - PlotUtils.cgraddefaults(default = PlotThemes.gradient_name(s)) + PlotUtils.clibrary(:Plots) + PlotUtils.default_cgrad(default = PlotThemes.gradient_name(s)) end default(; bg = thm.bg_secondary,