# How to use one color for a surface?

**URL:** <https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483>\
**Category:** Visualization\
**Tags:** plotting, plots, gr\
**Created:** [October 9, 2021, 8:16pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483 "2021-10-09T20:16:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [October 9, 2021, 8:16pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483/1 "2021-10-09T20:16:04Z")

</div>

Hello

I am trying to use only one color for a surface, but unfortunately I cannot find any example doing this.

The command to generate the surface is simply:

```julia
surface(rand(5),rand(5),rand(5))

```

But I cannot find the inputs to specify one specific color.

Kind regards

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 9, 2021, 8:36pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483/2 "2021-10-09T20:36:26Z")

</div>

Using plotly backend, this works:

```julia
using Plots; plotly()
surface(rand(5),rand(5),rand(5,5), color=:red)

```

_ **NB:** note that `z` is 5x5_

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [October 9, 2021, 8:39pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483/3 "2021-10-09T20:39:25Z")

</div>

> [@rafael.guerra](#):
>
> `surface(rand(5),rand(5),rand(5,5), color=:red)`

I am using the default of Plots, which is Gr. That command does not work there. I found this workaround:

```julia
    my_cg = cgrad([:green,:green])
    p_surf = surface(x,y,z,c=my_cg,colorbar=false)

```

Which produces a surface of uniform color in an annoying fashion by having to specify a custom colorbar.

Kind regards, thanks for your suggestion

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [October 10, 2021, 2:47pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483/4 "2021-10-10T14:47:22Z")

</div>

The GR documentation talks about an “option” argument that looks like it will do what you want. I’d like to use this argument too, but I can’t figure out how to pass it to the backend. It’s not a keyword argument, so extra\_kwargs doesn’t work.

[https://gr-framework.org/julia-gr.html#GR.surface-e3e6f234cc6cd4713b8727c874a5f331](https://gr-framework.org/julia-gr.html#GR.surface-e3e6f234cc6cd4713b8727c874a5f331)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 10, 2021, 2:51pm UTC](https://discourse.julialang.org/t/how-to-use-one-color-for-a-surface/69483/5 "2021-10-10T14:51:15Z")

</div>

GR.jl package functionalities go beyond those of the `Plots.jl gr()` backend used by OP.  
Maybe you could create a separate post.
