How to replace markers with words in Scatter plot?

Hi,

Is there a way to replace markers with words on a graph ?

My current function call is as the following:

trace = go.Scatter(
                x = xtsne[:,0],
                y = xtsne[:,1],
                marker = dict(
                size = 5,
                color = 'rgb(255, 0, 0)',
                line = dict(
                    width = 2,
                )),
                mode= 'markers',
                text = labels
                )

Thank you.

Hi there,
You can use mode='text'
See an example here: https://plot.ly/python/text-and-annotations/#adding-text-to-data-in-line-and-scatter-plots

1 Like