Hello,
I am a bit new to Plotly, and I was wondering if it is possible to add one or several vertical lines to a line plot, which are possible to move with mouse press (and then placed at the new x-value when mouse released) along the x-axis?
(For Python)
Thanks!
This is a simple example of the code:
import panel as pn
pn.extension('plotly')
import plotly.express as pex
fig = pex.line(x=[1,2,3,4,5,6], y=[2,3,1,5,3,4])
vline = fig.add_vline(x=3)
plot = pn.pane.Plotly(fig,config={'modeBarButtonsToAdd':['drawline','drawopen','eraseshape','path','drawclosedpath',
'drawcircle','drawrect',
], 'doubleClick': 'reset', 'responsive': True, 'displaylogo': False})
col = pn.Row(plot)
col
So I want to be able to click on the vertical line, then move it left or right and place it there, and save the new x-value.