Arrows in a scatter plot


#1

Hi,

I’m making a simple scatter plot like:

import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot

latt_x = [0, 1, 1.3, 0.5]
latt_y = [0, 1, 0.1, 1.8]
trace = go.Scatter(x = latt_x, y = latt_y, mode = 'markers',
                marker = dict(size = 20, color = 'rgba(0, 0, 0, 1)',
                line = dict(width = 2, color = 'rgb(0, 0, 0)')),
)
iplot([trace])

Is it possible to draw an arrow between two specific points in the scatter plot?

Thanks,

Adriaan


#2

You can use an arrow annotation for this task: https://plot.ly/python/text-and-annotations/#styling-and-coloring-annotations


#3

I think that what the original poster wanted (or at least what I want) is arrows between points in the scatterplot, not annotations on a single points. Imagine a scatterplot where the mode is markers and lines, but you need those lines to actually be arrows.