# How to generate 3D surface plot using a color scale that comprises of colors like Red,Yellow & Green

**URL:** <https://community.plotly.com/t/how-to-generate-3d-surface-plot-using-a-color-scale-that-comprises-of-colors-like-red-yellow-green/10555>\
**Category:** plotly.js\
**Created:** [May 29, 2018, 8:03am UTC](https://community.plotly.com/t/how-to-generate-3d-surface-plot-using-a-color-scale-that-comprises-of-colors-like-red-yellow-green/10555 "2018-05-29T08:03:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sagar](https://community.plotly.com/u/sagar)\
**Post date:** [May 30, 2018, 2:17pm UTC](https://community.plotly.com/t/how-to-generate-3d-surface-plot-using-a-color-scale-that-comprises-of-colors-like-red-yellow-green/10555/5 "2018-05-30T14:17:26Z")

</div>

I have already tried the custom ‘colorscale’ property with the given color scales :-

colorscale : [  
[‘0’, ‘rgb(255,0,0)’]  
[‘1.0’, ‘rgb(0,255,0)’]  
]

The colors just refuse to change ☹

Also, I have based the color scale on x-axis with the following attribute:  
surfacecolor: xArray[0]  
Here xArray contains value for x-axis which is a 1D array of values spanning from 500.00 to 7000.00 in steps of 250.

Still nothing changes!! Please see pic below,

 ![custom_color](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/e/eb5c535b607cf75efe2e9980a1acfff06ae3854a.png)

---

_[View the full topic](https://community.plotly.com/t/how-to-generate-3d-surface-plot-using-a-color-scale-that-comprises-of-colors-like-red-yellow-green/10555)._
