-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enhancing color gradient support #3
Comments
To implement this, it would be great if someone could direct me to
Thanks. |
@mkborregaard I wouldn't mind tinkering with gradtype if you can give some pointers on how to get started. My motivation is eventually getting heatmaps with categorical colormaps. |
Hey that sounds great. Do you mean tinkering with |
Relevant: JuliaPlots/Plots.jl#383 |
I suggest enhancing the interface for color gradients. I will try to implement this myself, so this issue is to discuss the applicability and the interface.
The suggested interface is a magic attribute (
color
?) with the following elements:color
: the name of the gradient, e.g.:magma
, but also offers:default
: the default value, probably equal to:sequential
:sequential
: a sequential gradient, such as:magma
:diverging
: a diverging gradient, such as:redsblues
, e.g. used when the color variable is a standard variation:dark
: or something else - this is an example of other defaults that may be implementedcollection
: the gradient collection to look in; see issue Using color collections for gradients #4clim
: the current clim argument but with extra keywords for common specifications:max_0
: clims are[minimum(x), 0]
, where x is the vector of values for the colors:min_0
: clims are[0, maximum(x)]
:center_0
: clims are[-y, y]
;y = maximum(abs([extrema(x)...]))
gradtype
: one of:stretched
: the current default, choose colors from a continuous gradient:equal_interval
: divide the numerical gradient intoclasses
number of bins (makes it easier to read values from plots). The default whenclasses
is an integer:classified
: a common synonym for:equal_interval
:quantiles
: divide x intoclasses
bins with the same number of observations in each:custom
: rarely specified directly, but the default whenclasses
is passed a vector. Useful for e.g.classes = [-2, 1, 0, 1, 2]
when the color reflects a standard deviation (or other standardized measure)classes
: can take eitherInt
specifying the number of bins for:equal_interval
and:quantiles
Vector{T <: Number}
specifying custom break points for the color scales. Ifgradtype
is:quantiles
this may be a vector of percentile values (e.g.classes = [0.025, 0.5, 0.975]
)This interface would allow the users to use color much more succinctly and powerfully for scientific graphing, choropleths etc.
Note that the
:color
keyword is currently used to refer to both colors and gradients - with @oxinabox very increased number of named colours it may be necessary to rename to avoid confusion?The text was updated successfully, but these errors were encountered: