Hello guys, I have a scatterplot here but I would love to actually show the index of the marker and the coordinates at the same time… how do I do this?
I have seen that you might be able to do that with hoverinfo and text, but I tried that and had no luck.
Your text variable needs to be a list (or pandas Series?) with the same length as the data. Your try above will result in a single value (something like "Index: RangeIndex(1, 20)"), while Ola’s suggestion will likely result in an error.
I think that 'text': ('Index: ' + df.index).tolist() should work. The .tolist() may be unnecessary.
So looking back at your original post, it looks like you’re not going to get what you want, which is the actual value being shown. I think that 'text': df.index.to_series() + '\n( ' + df['COORDENADA_X_PT'] + ', ' + df['COORDENADA_Y_PT'] + ')' should do what you actually want.