# HoverInfo index of an \[x,y,z\] point on a 3D scatter plot

**URL:** <https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924>\
**Category:** 📊 Plotly Python\
**Created:** [February 21, 2019, 5:00pm UTC](https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924 "2019-02-21T17:00:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mischki](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mischki](https://community.plotly.com/u/mischki)\
**Post date:** [February 21, 2019, 5:00pm UTC](https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924/1 "2019-02-21T17:00:24Z")

</div>

Hi,  
How can I add a hoverinfo within a 3D scatter plot, so that it displays the index of the particular 3D [x,y,z] coordinate? The hoverinfo seems to only like " - Any combination of [‘x’, ‘y’, ‘z’, ‘text’, ‘name’] joined with ‘+’ characters"  
I stored the indices of each xyz point in an array. Is there a way to incorporate it into the plot?  
Thanks.

-Misha.

---

<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:** [February 22, 2019, 11:05am UTC](https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924/2 "2019-02-22T11:05:08Z")

</div>

Hi @mischki,

You could set the `hovertext` property (See [https://plot.ly/python/reference/#scatter3d-hovertext](https://plot.ly/python/reference/#scatter3d-hovertext)) to an array of the the point indices (I think a list of numbers should work fine, but if you run into a problem then try converting it to a list of strings). Then make sure the `hoverinfo` includes `'text'`

Hope that helps!

-Jon

---

<div class="post-metadata">

**Author:** ![mischki](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mischki](https://community.plotly.com/u/mischki)\
**Post date:** [February 22, 2019, 4:55pm UTC](https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924/3 "2019-02-22T16:55:43Z")

</div>

Thank you! Hovertext did the trick. I just have to figure out how to display the element of my array corresponding to the particular point over which the cursor is hovering. Right now it’s displaying the whole array.

---

<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:** [February 25, 2019, 10:55am UTC](https://community.plotly.com/t/hoverinfo-index-of-an-x-y-z-point-on-a-3d-scatter-plot/19924/4 "2019-02-25T10:55:52Z")

</div>

> [@mischki](#):
>
> I just have to figure out how to display the element of my array corresponding to the particular point over which the cursor is hovering. Right now it’s displaying the whole array

Are you passing a list of numbers as `hovertext`? That seems to work for me,  
-Jon
