# How to plot color in scatter3d based on the value of z direction using backends: plotlyjs

**URL:** <https://discourse.julialang.org/t/how-to-plot-color-in-scatter3d-based-on-the-value-of-z-direction-using-backends-plotlyjs/97712>\
**Category:** Visualization\
**Tags:** plotlyjs\
**Created:** [April 20, 2023, 6:26pm UTC](https://discourse.julialang.org/t/how-to-plot-color-in-scatter3d-based-on-the-value-of-z-direction-using-backends-plotlyjs/97712 "2023-04-20T18:26:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jianqixi](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Post date:** [April 20, 2023, 6:26pm UTC](https://discourse.julialang.org/t/how-to-plot-color-in-scatter3d-based-on-the-value-of-z-direction-using-backends-plotlyjs/97712/1 "2023-04-20T18:26:20Z")

</div>

Hi, I am trying to plot the scatter points using scatter3d, I am wondering how to color the points based on the value of z direction. Thanks

---

<div class="post-metadata">

**Author:** ![jianqixi](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Post date:** [April 20, 2023, 7:40pm UTC](https://discourse.julialang.org/t/how-to-plot-color-in-scatter3d-based-on-the-value-of-z-direction-using-backends-plotlyjs/97712/2 "2023-04-20T19:40:09Z")

</div>

the marker\_z may help me to achieve my goal, but the weird thing is that why it has so many white color, as shown below.

![image](https://global.discourse-cdn.com/julialang/original/3X/d/1/d14b2bd7709aaff6a3194c712dce6952a95f3100.png)

I prefer to get the based on the height value in z, which means that the color should be ranged from the dark blue to red. Thanks

---

<div class="post-metadata">

**Author:** ![jianqixi](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Post date:** [April 20, 2023, 7:43pm UTC](https://discourse.julialang.org/t/how-to-plot-color-in-scatter3d-based-on-the-value-of-z-direction-using-backends-plotlyjs/97712/3 "2023-04-20T19:43:37Z")

</div>

Now, I got it, it is because of the setting of marker. Thanks
