# \[ANN\] Fatou.jl : Easily share Julia fractals

**URL:** <https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278>\
**Category:** Community\
**Tags:** package, announcement, plotting, fractal\
**Created:** [July 9, 2018, 5:30pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278 "2018-07-09T17:30:04Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 20, 2019, 5:51pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/21 "2019-01-20T17:51:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 20, 2019, 5:53pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/22 "2019-01-20T17:53:15Z")

</div>

This page has more information [https://matplotlib.org/tutorials/colors/colormaps.html](https://matplotlib.org/tutorials/colors/colormaps.html)

and also here [https://matplotlib.org/tutorials/colors/colormap-manipulation.html](https://matplotlib.org/tutorials/colors/colormap-manipulation.html)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [January 21, 2019, 1:07am UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/23 "2019-01-21T01:07:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 21, 2019, 1:35am UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/24 "2019-01-21T01:35:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 21, 2019, 7:14am UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/25 "2019-01-21T07:14:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 21, 2019, 8:26am UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/26 "2019-01-21T08:26:15Z")

</div>

Sounds like a [good idea](https://github.com/JuliaLang/julia/issues/19004) ( 🙂 ). Perhaps the dependency on Images.jl could be transferred to a `...Utils` package.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 21, 2019, 1:20pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/27 "2019-01-21T13:20:09Z")

</div>

> [@chakravala](#):
>
> For example, such as `ocean` , `gist_earth` , `gnuplot`

While converting the ones in [https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/\_cm.py](https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py) I skipped a few, mainly the ones with `lambda`s in them (since I don’t speak Python, I’m not sure what these `lambda`s are doing).

```python
_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):

 ![58](https://global.discourse-cdn.com/julialang/original/3X/b/d/bddd070b2777a1c5950ee1c01707f25185842028.png)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [January 21, 2019, 1:28pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/28 "2019-01-21T13:28:14Z")

</div>

These `lambda`s indicate [anonymous functions](https://docs.julialang.org/en/v1/manual/functions/#man-anonymous-functions-1) (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`

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 21, 2019, 2:03pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/29 "2019-01-21T14:03:13Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 21, 2019, 2:18pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/30 "2019-01-21T14:18:37Z")

</div>

> [@mkborregaard](#):
>
> Great - let’s start it under JuliaGraphics and start hashing on the design?

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](https://github.com/peterkovesi/PerceptualColourMaps.jl/issues/15).

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 21, 2019, 2:39pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/31 "2019-01-21T14:39:30Z")

</div>

> [@mkborregaard](#):
>
> 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.

Just because the `flag` gradient isn’t useful for traditional plotting, doesn’t mean that it’s completely useless

![flag](https://global.discourse-cdn.com/julialang/original/3X/3/e/3ec4ada44ee841e66bd1819b1f764f011d6bdc4c.png)

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

> **[Covering space](https://en.wikipedia.org/wiki/Covering_space)**
>
> In topology, a covering or covering projection is a surjective map between topological spaces that, intuitively, locally acts like a projection of multiple copies of a space onto itself. In particular, coverings are special types of local homeomorphisms. If 
>   
>     
>       
> p
> :
>         
>           
>             
> X
> ~
>             
>           
>         
> →
> X
>       
>     
> {\\displaystyle p:{\\tilde {X}}\\to X}
>   
> is a covering, 
>   
>     
>       
> ...

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…

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 21, 2019, 3:02pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/32 "2019-01-21T15:02:09Z")

</div>

> [@chakravala](#):
>
> So I would hope all the color schemes are treated equally…

I really would hope not 🙂 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).

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 21, 2019, 3:16pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/33 "2019-01-21T15:16:17Z")

</div>

> [@mkborregaard](#):
>
> that this is inappropriate for visualization of numerical magnitudes

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.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 21, 2019, 3:24pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/34 "2019-01-21T15:24:01Z")

</div>

> [@chakravala](#):
>
> there should also be a function which simply lets you pick from any color map from a string name without discrimination.

Yes, definitely

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 21, 2019, 6:35pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/35 "2019-01-21T18:35:38Z")

</div>

[https://github.com/JuliaGraphics/ColorSchemes.jl/issues/19](https://github.com/JuliaGraphics/ColorSchemes.jl/issues/19)

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 22, 2019, 5:11pm UTC](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278/36 "2019-01-22T17:11:36Z")

</div>

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

 ![asymetric](https://global.discourse-cdn.com/julialang/original/3X/1/a/1ae0b1b2f216a7a7387b01b0274bdf687e1ed1bb.png)

[Previous page](https://discourse.julialang.org/t/ann-fatou-jl-easily-share-julia-fractals/12278.md?page=1)
