・ It is possible to check the contents of the data with a tooltip.
import matplotlib.pyplot as plt
import numpy as np
import random
from bokeh.io import output_notebook, show
from bokeh.plotting import figure,show
output_notebook()
x = np.linspace(1, 10, 10)
y = [random.randint(0, 10) for i in range(10)]
TOOLTIPS = [
("index", "$index"),
("(x,y)", "($x, $y)"),
]
#Graph settings
p = figure(tooltips=TOOLTIPS, title="Graph title", x_axis_label="x axis", y_axis_label="y axis")
#Scatter plot
p.circle(x = x,y = y)
#show(p)
#Line graph
#p.line(x = x,y = y)
#show(p)
#bar graph
#p.vbar(x = x,top = y,width=0.5)
show(p)
Recommended Posts