Skip to content

Commit

Permalink
make sure all libraries have a diverging type
Browse files Browse the repository at this point in the history
  • Loading branch information
mkborregaard committed Feb 28, 2017
1 parent b04b815 commit 5175ee8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/color_gradients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const _rainbowColors = [colorant"purple", colorant"blue", colorant"green", color
const _testColors = [colorant"darkblue", colorant"blueviolet", colorant"darkcyan",colorant"green",
darken(colorant"yellow",0.3), colorant"orange", darken(colorant"red",0.2)]

const misc = ColorLibrary(Dict(:default => :heat), Dict(
const misc = ColorLibrary(Dict(:default => :sequential, :sequential => :heat, :diverging => :bluesreds), Dict(
:blues => [colorant"lightblue", colorant"darkblue"],
:reds => [colorant"lightpink", colorant"darkred"],
:greens => [colorant"lightgreen", colorant"darkgreen"],
Expand Down
12 changes: 0 additions & 12 deletions src/gradients/colorbrewer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,6 @@ register_gradient_colors(:RdGy, [
RGB(77/255, 77/255, 77/255),
RGB(26/255, 26/255, 26/255)], :colorbrewer)

register_gradient_colors(:PuOr, [
RGB(127/255, 59/255, 8/255),
RGB(179/255, 88/255, 6/255),
RGB(224/255, 130/255, 20/255),
RGB(253/255, 184/255, 99/255),
RGB(254/255, 224/255, 182/255),
RGB(247/255, 247/255, 247/255),
RGB(216/255, 218/255, 235/255),
RGB(178/255, 171/255, 210/255),
RGB(128/255, 115/255, 172/255),
RGB(84/255, 39/255, 136/255),
RGB(45/255, 0/255, 75/255)], :colorbrewer)

# These are commented out as they constitute non-continuous gradients, and are thus used differently by Plots
# register_gradient_colors(:Set2, [
Expand Down
16 changes: 15 additions & 1 deletion src/gradients/matplotlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# note: to use the full arrays, just take out the second param (n) from the sample_evenly calls

register_color_library(:Plots, ColorLibrary(Dict(:default => :sequential, :sequential => :inferno)))
register_color_library(:Plots, ColorLibrary(Dict(:default => :sequential, :sequential => :inferno, :diverging => :PuOr)))

register_gradient_colors(:magma, sample_evenly([
RGB(0.001462, 0.000466, 0.013866),
Expand Down Expand Up @@ -1060,6 +1060,20 @@ register_gradient_colors(:viridis, sample_evenly([
], 30), :Plots)



register_gradient_colors(:PuOr, [
RGB(127/255, 59/255, 8/255),
RGB(179/255, 88/255, 6/255),
RGB(224/255, 130/255, 20/255),
RGB(253/255, 184/255, 99/255),
RGB(254/255, 224/255, 182/255),
RGB(247/255, 247/255, 247/255),
RGB(216/255, 218/255, 235/255),
RGB(178/255, 171/255, 210/255),
RGB(128/255, 115/255, 172/255),
RGB(84/255, 39/255, 136/255),
RGB(45/255, 0/255, 75/255)], :Plots)

# end of Plots colormaps
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------

0 comments on commit 5175ee8

Please sign in to comment.