JuliaGraphics / ColorSchemes.jl

colorschemes, colormaps, gradients, and palettes
http://juliagraphics.github.io/ColorSchemes.jl/
Other
188 stars 35 forks source link

Add `cividis` colormap #96

Closed t-bltg closed 2 years ago

t-bltg commented 2 years ago

Adds support for cividis colormap from https://github.com/marcosci/cividis under MIT licensing.

codecov[bot] commented 2 years ago

Codecov Report

Merging #96 (0607f60) into master (bcf62f7) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #96   +/-   ##
=======================================
  Coverage   75.00%   75.00%           
=======================================
  Files           1        1           
  Lines         116      116           
=======================================
  Hits           87       87           
  Misses         29       29           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bcf62f7...0607f60. Read the comment docs.

cormullion commented 2 years ago

Hi! The reason cividis isn't in is because it was already in PlotUtils and Makie, etc.. I'm guessing there won't be any problems in duplicating the colorscheme here as well, but it would be great if you could test your fork against Plots etc to check that there isn't a clash at any stage....

t-bltg commented 2 years ago

Hum, Plots uses ColorSchemes, :cividis got introduced in https://github.com/JuliaPlots/PlotUtils.jl/pull/87, with no mention why it was added there and not in ColorSchemes, the table should be removed if introduced here.

I've tested this PR with (@v1.7) pkg> test Plots and (@v1.7) pkg> test Makie without issues.

I'll need this for https://github.com/JuliaPlots/UnicodePlots.jl/pull/272.

cormullion commented 2 years ago

Cool, thanks! I'll make a release today or tomorrow...

cormullion commented 2 years ago

by the way - will I need to update this when your UnicodePlots updates are done?

t-bltg commented 2 years ago

No, providing a Vector of RGB tuples will still supported.

By the way, savefig(p, "name.png") is supported since UnicodePlots 2.10 (and integrates well with png(...) from Plots) ;)

using ColorSchemes, UnicodePlots
z = rand(50, 100)
p = heatmap(z; title = "Hot!", colormap = map(x -> (x.r, x.g, x.b), ColorSchemes.leonardo.colors))
savefig(p, "hot.png"; transparent = false)

hot

cormullion commented 2 years ago

Cool, thanks. UnicodePlots remains awesome 😀