# How to assign Syrfacecolor?

**URL:** <https://community.plotly.com/t/how-to-assign-syrfacecolor/25167>\
**Category:** 📊 Plotly Python\
**Created:** [June 28, 2019, 7:05am UTC](https://community.plotly.com/t/how-to-assign-syrfacecolor/25167 "2019-06-28T07:05:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanis](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vanis](https://community.plotly.com/u/vanis)\
**Post date:** [June 28, 2019, 7:05am UTC](https://community.plotly.com/t/how-to-assign-syrfacecolor/25167/1 "2019-06-28T07:05:20Z")

</div>

Hi!  
I try to use surface color in python, but I haven’t understood the example in documentation. May someone helps me?

surf =go.Surface(x=X1,y=Y1,z=Z1, surfacecolor=intensity)

X1, Y1, Z1 are two-dimensional arrays.  
intensity – three-dimensional array, first and second idexes correspond to X1 and Y1, third is for RGB: intensity[:,:,0] is for red, intensity[:,:,1] is for green and intensity[:,:,2] is for blue.

What should I do to assign RGB numbers to surfacecolor?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [June 28, 2019, 10:12am UTC](https://community.plotly.com/t/how-to-assign-syrfacecolor/25167/2 "2019-06-28T10:12:57Z")

</div>

Hi @vanis,

Surface traces are colored by mapping the `surfacecolor` numeric values to colorsing using the current colorscale. So you’ll need to pass something to the `surfacecolor` property that is a 2D array of numbers that has the same 2D shape as `x` `y` and `z`. Then this will get mapped to colors according to the colorscale specified in the `colorscale` property.

Hope that helps clear things up,  
-Jon

---

<div class="post-metadata">

**Author:** ![vanis](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vanis](https://community.plotly.com/u/vanis)\
**Post date:** [June 28, 2019, 1:00pm UTC](https://community.plotly.com/t/how-to-assign-syrfacecolor/25167/3 "2019-06-28T13:00:12Z")

</div>

Thanks, I’ve got it)
