# Mesh3d facecolor

**URL:** https://discourse.julialang.org/t/mesh3d-facecolor/118294
**Category:** Visualization
**Tags:** plotting, plots, makie, meshes
**Created:** [August 16, 2024, 9:12pm UTC](https://discourse.julialang.org/t/mesh3d-facecolor/118294 "2024-08-16T21:12:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Domenico\_Lahaye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/domenico_lahaye/32/203728_2.png) [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)
#### Post date: [August 16, 2024, 9:12pm UTC](https://discourse.julialang.org/t/mesh3d-facecolor/118294/1 "2024-08-16T21:12:30Z")

</div>

I am trying to change the facecolor. Part of the issue is that I have a limited understanding of the various backends to Plots.jl . The same issue was raised here at various occasions. I continue to struggle.

```julia
x = [0, 1, 2, 0]
y = [0, 0, 1, 2]
z = [0, 0, 0, 0]
i = [0]
j = [1]
k = [2]
mesh3d(x, y, z; connections = (i, j, k),facecolor=RGB(1.,0.,0.))

```

---

<div class="post-metadata">

### Author: ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)
#### Post date: [August 17, 2024, 10:59am UTC](https://discourse.julialang.org/t/mesh3d-facecolor/118294/2 "2024-08-17T10:59:59Z")

</div>

I don’t think that is implemented yet.  
Contributions welcome!

---

<div class="post-metadata">

### Author: ![berjine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/berjine/32/51764_2.png) [@berjine](https://discourse.julialang.org/u/berjine)
#### Post date: [August 17, 2024, 12:13pm UTC](https://discourse.julialang.org/t/mesh3d-facecolor/118294/3 "2024-08-17T12:13:56Z")

</div>

Sorry if that does not really answer you question but you can do this in Makie :

> [@Makie: Triangle face colour, mesh](https://discourse.julialang.org/t/makie-triangle-face-colour-mesh/18011/2):
>
> You can obtain flat coloured patches by a naive duplication of nodes to ensure that every triangle has different (eventually duplicated) vertices.

```julia
points = [0.0 0.0 0.0; 
          1.0 0.0 0.0; 
          2.0 1.0 0.0; 
          2.0 1.0 0.0;
          0.0 2.0 0.0;
          0.0 0.0 0.0];
faces = [1 2 3;
         4 5 6];
colors = [:red, :red, :red, :blue, :blue, :blue]
# colors = [0.2, 0.2, 0.2, 0.8, 0.8, 0.8] #for use with a colormap
f = Figure()
ax = Axis3(f[1,1], aspect=:data)
mesh!(ax, points, faces, color=colors)
# mesh!(ax, points, faces, color=colors, colormap=:plasma, colorrange=(0.0, 1.0))
f

```

 ![SharedScreenshot](https://global.discourse-cdn.com/julialang/original/3X/5/4/54e178527aee5c9986d80e5e27798e1fcb89f6fa.jpeg)

---

<div class="post-metadata">

### Author: ![Domenico\_Lahaye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/domenico_lahaye/32/203728_2.png) [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)
#### Post date: [August 17, 2024, 4:45pm UTC](https://discourse.julialang.org/t/mesh3d-facecolor/118294/4 "2024-08-17T16:45:08Z")

</div>

Thanks! I am new to Makie. I will give it a look!

Edit: got Makie to work.

Q1: is it wise to refine the function map\_z2color at e.g. [https://plotly.com/python/v3/surface-triangulation/](https://plotly.com/python/v3/surface-triangulation/) in Julia?

Q2: is there a similar example in Makie ?

Thx!
