[ANN] Fatou.jl : Easily share Julia fractals

I can add them tomorrow, but it will be easier if I can find the actual color definitions somewhere, rather than just the swatches.

This page has more information https://matplotlib.org/tutorials/colors/colormaps.html

and also here https://matplotlib.org/tutorials/colors/colormap-manipulation.html

You can define your own colour maps in Plots.jl IIRC. Or let the user do it themselves?

1 Like

Yes, Iā€™ve always had plans to make the color maps in Fatou independent of PyPlot, which can be solved with the use of ColorSchemes package. Unfortunately, Iā€™ve not had the time to prioritize this.

The interface will generalize, please share if you have any specific interface example in mind.

The problem with ColorSchemes is that itā€™s a package with a big list of heavy dependencies, which is unneccesary for just providing color schemes (but useful for doing the other things you can do here). @cormullion maybe we should make that dependency-free ColorMaps package that simply holds color swatches, uses submodules to hold different libraries, and can be depended on by Colors, ColorSchemes, PlotUtils, Makie etc.?
We could ask some of the other libraries like colorbrewer.jl and noveltycolors and perceptualcolormaps to just put swatches in there (or basic functions describing the rgb curves if thatā€™s preferred) so that we consolidate colorschemes in Julia.

2 Likes

Sounds like a good idea ( :slight_smile: ). Perhaps the dependency on Images.jl could be transferred to a ...Utils package.

While converting the ones in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py I skipped a few, mainly the ones with lambdas in them (since I donā€™t speak Python, Iā€™m not sure what these lambdas are doing).

_flag_data = {
        'red': lambda x: 0.75 * np.sin((x * 31.5 + 0.25) * np.pi) + 0.5,
        'green': lambda x: np.sin(x * 31.5 * np.pi),
        'blue': lambda x: 0.75 * np.sin((x * 31.5 - 0.25) * np.pi) + 0.5,
}

which generates this (obviously very useful):

These lambdas indicate anonymous functions (also called lambda functions).

In Julia,

lambda x: 0.75 * np.sin((x * 31.5 + 0.25) * np.pi) + 0.5

should be written as

x -> 0.75 * sin((x * 31.5 + 0.25) * pi) + 0.5

3 Likes

Great - letā€™s start it under JuliaGraphics and start hashing on the design? I support the most minimal possible. I donā€™t think such a package would need any dependencies at all other than colors (for rgb). It should just have the colors, perhaps functionality to have both discrete and floating point indexing, and some default way of categorizing colorgradients (perhaps as traits) (sequential, categorical, diverging, isoluminant, monochromatic, color-blind friendly, perceptually uniform).
In particular I think it should distinguish those with good visual properties from those that donā€™t have that (like that awful flag scheme, or jet) as most people are naive about color gradients. Thatā€™s been my biggest concern with doing that - at least in PlotUtils we can make sure that subpar schemes arenā€™t available.
Libraries in submodules would be a necessity, due to licensing and namespacing.
OK Iā€™ll stop hijacking the thread :slight_smile:

2 Likes

If you do start a repo/discussion, please link it here. I would make sure PGFPlotsX works with it, and also some packages could use it to split functionality.

1 Like

Just because the flag gradient isnā€™t useful for traditional plotting, doesnā€™t mean that itā€™s completely useless

flag

for example, it can be used to make that ^ which is fun since flag acts like a topological covering-projection

That flag colorscheme is a covering projection map, where each color is mapped from a disjoint domain

So I would hope all the color schemes are treated equallyā€¦

2 Likes

I really would hope not :slight_smile: but I think this can be solved by a trait-based approach that clearly highlights e.g. that this is inappropriate for visualization of numerical magnitudes but may have other uses (like also, eg. the topographical colors).

Technically, this is exactly what I used that map for, to visualize numerical values on a covering space, so the use which I used it for still is under numerical visualization, so I canā€™t accept that classification.

The string interface is really convenient, because it makes reproducible color maps very simple / memorable and you only need to know letā€™s say, one function to reach them all.

How do you envision using traits? There should be specific trait-based constructors, but there should also be a function which simply lets you pick from any color map from a string name without discrimination.

Yes, definitely

https://github.com/JuliaGraphics/ColorSchemes.jl/issues/19

1 Like

This package can help remind that thereā€™s always something more weird, yet simple, around the corner

6 Likes