how to point to graph can create a text file or csv file for feature, after point the data in graph, it
create a vertical line in graph and mark 1 in data ,
for example 100 data , third extra column [0…0] 100 zero intially , after point the second column one of data
it change one of zero in the array of 100 zeros corresponding to the position of x axis
import plotly.plotly as py
import plotly.graph_objs as go
import plotly
import numpy as np
import pandas as pd
import plotly.figure_factory as FF
import plotly.graph_objs as go
df = pd.read_csv(‘hello.csv’)
sample_data_table = FF.create_table(df.head())
fig = go.FigureWidget([go.Scatter(x = df[‘Date’], y = df[‘Close’], mode=‘markers’)])
def update_point(trace, points, selector):
c = list(scatter.marker.color)
s = list(scatter.marker.size)
for i in points.point_inds:
c[i] = ‘#bae2be’
s[i] = 20
scatter.marker.color = c
scatter.marker.size = s
In order to use callbacks like on_click, you should not display the figure with iplot. Instead, let the figure display itself by making fig the last expression in the cell.
Not for other people, for myself to create feature data easily , sometimes feel statistics can not mark feature ideally completely and exactly though have not tried.
In order to have the FigureWidget display as a plot there are some extra dependencies needed. See https://github.com/plotly/plotly.py#installation and follow instructions for the Jupyter Notebook or JupyterLab (depending on which one you are using).