Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categorical color palettes #383

Closed
axsk opened this issue Jul 8, 2016 · 3 comments
Closed

Categorical color palettes #383

axsk opened this issue Jul 8, 2016 · 3 comments
Labels
enhancement improving existing functionality

Comments

@axsk
Copy link

axsk commented Jul 8, 2016

While the current gradient palettes :inferno, :heat, :blues are suited to plot sequential data, reflecting their ordererd structure, I propose adding additional "categorical" (name suggestions are welcome) palettes with presets of distuingishable colors.

Here are some suggestions that I stumbled upon looking for such palettes two years ago.

  • Few (from Stephen Few, Show Me the Numbers)

The RGB values can be found in this gist.

Does anyone know if there are copyrights on colors?

Edit: Concerning the API I would suggest just adding new symbols for the palettes to the palette kwarg, i.e. plot(..., palette=:set3). Given n series, I think these should get mapped to the first n sequential colors of the palette, since I consider the correct/distuingishable ordering to be the task of the palette (and as far as I remember above palettes took this into account)

@tbreloff
Copy link
Member

tbreloff commented Jul 8, 2016

I certainly like the idea of having some pre-defined palettes available. We do have to be weary of copying without a proper license. (yes, palettes can be copy-protected)

There are already several sources of "distinguishable palettes". I think I'd like to make sure those can easily be used, and if we have pre-defined ones we could store in a Dict.

So the logic would be roughly:

if haskey(_categorical_palettes, v)
    # force color list
elseif # v is a color vector
    # force color list
elseif haskey(_gradients, v)
    # build palette from gradient
else
    # do the "distinguishable_colors method"
end

@tbreloff tbreloff added the enhancement improving existing functionality label Sep 30, 2016
@mkborregaard
Copy link
Member

I have opened an issue for enhanced color suppor in PlotUtils (where I think this stuff belongs) JuliaPlots/PlotUtils.jl#3 . That issue is for gradients, but I agree that other sequential palettes also belongs naturally here, as part of color libraries (PR here JuliaPlots/PlotUtils.jl#5) .
With regards to @axsk question of copyright, many gradients come with a reasonably permissive license, but most require attribution. Putting gradient libraries such as colorbrewer in PlotUtils allows the license to be displayed there.

@mkborregaard
Copy link
Member

Closed in favour of JuliaPlots/PlotUtils.jl#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improving existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants