# Complex colormap in Julia Plots?

**URL:** <https://discourse.julialang.org/t/complex-colormap-in-julia-plots/84212>\
**Category:** General Usage\
**Tags:** question, images, plots, complex-numbers\
**Created:** [July 14, 2022, 8:33am UTC](https://discourse.julialang.org/t/complex-colormap-in-julia-plots/84212 "2022-07-14T08:33:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![moeddel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moeddel/32/18641_2.png) [@moeddel](https://discourse.julialang.org/u/moeddel)\
**Post date:** [July 14, 2022, 10:53am UTC](https://discourse.julialang.org/t/complex-colormap-in-julia-plots/84212/3 "2022-07-14T10:53:26Z")

</div>

We have quite recently added a function [`complexColoring`](https://github.com/tknopp/ImageUtils.jl/blob/e136dad7b005f544ef78e2f882ab53c5f4872a32/src/Coloring.jl#L158) into the package `ImageUtils`. It colors complex arrays using a desaturation colormap. It is designed such that changes in phase do not alter its gray value. From the example posted this seems to be what you want.

You can see the colormap in action in [one](https://arxiv.org/pdf/2106.08040.pdf) of our publications in figures 1 and 5.

> [@rafael.guerra](#):
>
> You can find a related Plots.jl example [in this other post](https://discourse.julialang.org/t/how-to-set-ticklabels-for-an-image-within-the-range-of-x-and-y/63637).

The example in this post does only encode phase and does not seem to desaturate towards z=0. If both phase and absolute value are important, this kind of coloring is not really suitable.

---

_[View the full topic](https://discourse.julialang.org/t/complex-colormap-in-julia-plots/84212)._
