# Which tools to do a chromaticity diagram?

**URL:** <https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230>\
**Category:** Visualization\
**Created:** [November 18, 2019, 4:53pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230 "2019-11-18T16:53:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [November 18, 2019, 4:53pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230/1 "2019-11-18T16:53:21Z")

</div>

I want to make some chromaticity diagrams (e.g.[Chromaticity - Wikipedia](https://en.wikipedia.org/wiki/Chromaticity#/media/File:PlanckianLocus.png)) and am not sure which Julia graphics package would be most suitable. I’ve been looking at Luxor, Plots, Makie, and Gadfly examples and am leaning to trying in Luxor, but would appreciate any pointers.

---

<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:** [November 18, 2019, 6:28pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230/2 "2019-11-18T18:28:55Z")

</div>

I wouldn’t advise Luxor - you’ll have to draw axes and tick marks manually which would be tedious… 🙂

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [November 18, 2019, 8:01pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230/3 "2019-11-18T20:01:39Z")

</div>

That’s a good point. I guess to be more specific, I want to be able to paint the colors within the diagram per my own functions, but also be able to place labeled points and polygons.

I may end up creating an image in one tool and then use another tool to add things on top of it.

I’m hoping for a unified approach though.

---

<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:** [November 18, 2019, 8:41pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230/4 "2019-11-18T20:41:35Z")

</div>

The Bezier meshes in Luxor might be quite useful, but they might be more for illustration purposes rather than precise scientific rendering tools:

```julia
@draw begin
    bp = makebezierpath(ngon(O, 250, 3, pi/6, vertices=true))
    mesh1 = mesh(bp, [
        "red",
        "green",
        "blue" ])
    setmesh(mesh1)
    drawbezierpath(bp, :fill)
end

```

---

<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:** [November 18, 2019, 10:05pm UTC](https://discourse.julialang.org/t/which-tools-to-do-a-chromaticity-diagram/31230/5 "2019-11-18T22:05:49Z")

</div>

The color part would probably most easily be done as an image, e.g. an `Matrix{Colorant}` with transparent values outside the defined space. Any plotting package in Julia should be able to display an image, and then add the lines on top. In Plots you’d just draw the line segments as a long black line with NaNs between segments, then add the numbers with `annotations`.
