From 0dc9cf191e7c355d645e497336e29adde0f6fba3 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Tue, 26 Nov 2019 14:24:22 +0100 Subject: [PATCH 1/5] replace gradient with colorgradient to avoid confusion with Plots quiver alias 'gradient' --- src/PlotThemes.jl | 4 ++-- src/dark.jl | 2 +- src/juno.jl | 2 +- src/juno_smart.jl | 2 +- src/lime.jl | 2 +- src/orange.jl | 2 +- src/sand.jl | 2 +- src/solarized.jl | 4 ++-- src/wong.jl | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/PlotThemes.jl b/src/PlotThemes.jl index a6dfc31..23ac5d1 100644 --- a/src/PlotThemes.jl +++ b/src/PlotThemes.jl @@ -36,8 +36,8 @@ const _themes = Dict{Symbol, PlotTheme}(:default => PlotTheme()) gradient_name(s::Symbol) = s == :default ? :inferno : Symbol(s, "_grad") function add_theme(s::Symbol, thm::PlotTheme) - if haskey(thm.defaults, :gradient) - PlotUtils.register_gradient_colors(gradient_name(s), thm.defaults[:gradient], :misc) + if haskey(thm.defaults, :colorgradient) + PlotUtils.register_gradient_colors(gradient_name(s), thm.defaults[:colorgradient], :misc) end _themes[s] = thm end diff --git a/src/dark.jl b/src/dark.jl index 55caef6..1e39e67 100644 --- a/src/dark.jl +++ b/src/dark.jl @@ -15,5 +15,5 @@ _themes[:dark] = PlotTheme( fgguide = colorant"#FFFFFF", fglegend = colorant"#FFFFFF", palette = expand_palette(dark_bg, dark_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:fire).colors + colorgradient = cgrad(:fire).colors ) diff --git a/src/juno.jl b/src/juno.jl index 09577bf..1184f08 100644 --- a/src/juno.jl +++ b/src/juno.jl @@ -16,5 +16,5 @@ _themes[:juno] = PlotTheme( fgguide = colorant"#9EB1BE", fglegend = colorant"#9EB1BE", palette = expand_palette(juno_bg, juno_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:fire).colors + colorgradient = cgrad(:fire).colors ) diff --git a/src/juno_smart.jl b/src/juno_smart.jl index 1a664d1..7d1253c 100644 --- a/src/juno_smart.jl +++ b/src/juno_smart.jl @@ -22,6 +22,6 @@ if Juno.isactive() fgguide = colors["variable"], fglegend = colors["variable"], palette = expand_palette(colors["background"], juno_palette; lchoices = [57], cchoices = [100]), - gradient = grad + colorgradient = grad ) end diff --git a/src/lime.jl b/src/lime.jl index 92bf9ef..420fc49 100644 --- a/src/lime.jl +++ b/src/lime.jl @@ -16,5 +16,5 @@ _themes[:lime] = PlotTheme( fgguide = lime_palette[2], fglegend = lime_palette[2], palette = expand_palette(black, lime_palette[1:4]), - gradient = cgrad(:viridis).colors + colorgradient = cgrad(:viridis).colors ) diff --git a/src/orange.jl b/src/orange.jl index 7bf880c..45c894e 100644 --- a/src/orange.jl +++ b/src/orange.jl @@ -17,5 +17,5 @@ _themes[:orange] = PlotTheme( fgguide = orange_palette[2], fglegend = orange_palette[2], palette = expand_palette(black, orange_palette[1:4]), - gradient = cgrad(:viridis).colors + colorgradient = cgrad(:viridis).colors ) diff --git a/src/sand.jl b/src/sand.jl index 83fbc4b..a66a5f4 100644 --- a/src/sand.jl +++ b/src/sand.jl @@ -18,5 +18,5 @@ _themes[:sand] = PlotTheme( fgguide = colorant"#725B61", fglegend = colorant"#725B61", palette = expand_palette(sand_bg, sand_palette), - gradient = cgrad(:dense).colors + colorgradient = cgrad(:dense).colors ) diff --git a/src/solarized.jl b/src/solarized.jl index ceed67b..6488573 100644 --- a/src/solarized.jl +++ b/src/solarized.jl @@ -28,7 +28,7 @@ _themes[:solarized] = PlotTheme( fgguide = _solarized_colors[:base01], fglegend = _solarized_colors[:base01], palette = expand_palette(_solarized_colors[:base03], [_solarized_colors[c] for c in _solarized_palette]), - gradient = cgrad(:YlOrRd_r).colors + colorgradient = cgrad(:YlOrRd_r).colors ) _themes[:solarized_light] = PlotTheme( @@ -39,5 +39,5 @@ _themes[:solarized_light] = PlotTheme( fgguide = _solarized_colors[:base1], fglegend = _solarized_colors[:base1], palette = expand_palette(_solarized_colors[:base3], [_solarized_colors[c] for c in _solarized_palette]), - gradient = cgrad(:YlOrRd_r).colors + colorgradient = cgrad(:YlOrRd_r).colors ) diff --git a/src/wong.jl b/src/wong.jl index 033ce31..aa7862a 100644 --- a/src/wong.jl +++ b/src/wong.jl @@ -12,10 +12,10 @@ const wong_palette = [ _themes[:wong] = PlotTheme( palette = expand_palette(colorant"white", wong_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:viridis).colors, + colorgradient = cgrad(:viridis).colors, ) _themes[:wong2] = PlotTheme( palette = expand_palette(colorant"white", [RGB(0,0,0); wong_palette]; lchoices = [57], cchoices = [100]), - gradient = cgrad(:viridis).colors, + colorgradient = cgrad(:viridis).colors, ) From dcd136540b9ec378319d5699ca8f24e51b5a7953 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Tue, 26 Nov 2019 14:26:25 +0100 Subject: [PATCH 2/5] add upper bounds on deps --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d724b25..b9aa039 100644 --- a/Project.toml +++ b/Project.toml @@ -8,8 +8,8 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -PlotUtils = "≥ 0.5.0" -julia = "≥ 0.7.0" +PlotUtils = "0.5, 0.6" +julia = "0.7, 1" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 06492e89078d917c97e96268576f4fc8198c8184 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Tue, 26 Nov 2019 14:29:09 +0100 Subject: [PATCH 3/5] add colorgradients in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c66dd0e..2ff7a4e 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ Themes can be previewed using `Plots.showtheme(thm::Symbol)`: ## Contributing A theme specifies default values for different Plots [attributes](http://docs.juliaplots.org/attributes/). -At the moment these are typically colors, palettes and gradients, but any Plots attribute can be controlled by a theme in general. +At the moment these are typically colors, palettes and colorgradients, but any Plots attribute can be controlled by a theme in general. PRs for new themes very welcome! Adding a new theme (e.g. `mytheme`) is as easy as adding a new file (mytheme.jl) that contains at least the following line: ```julia _themes[:mytheme] = PlotTheme(; kwargs...) ``` -The keyword arguments can be any collection of Plots attributes. +The keyword arguments can be any collection of Plots attributes plus a colorgradient keyword argument. From db805eb012bb78f2b156d92ac2e1efc2fe0d6ecb Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Tue, 26 Nov 2019 14:30:08 +0100 Subject: [PATCH 4/5] up version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b9aa039..dd7e315 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PlotThemes" uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" -version = "0.4.0" +version = "1.0.0" [deps] PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043" From fcf69a3df2820987823ec8aa112becea384da7d2 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 27 Nov 2019 14:29:12 +0100 Subject: [PATCH 5/5] add bounds for requires --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index dd7e315..94b363c 100644 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] PlotUtils = "0.5, 0.6" +Requires = "0.5" julia = "0.7, 1" [extras]