利用 Bokeh+数组 建图
导入figurefrom bokeh.plotting import figure
用于绘图;
导入output_filefrom bokeh.io import output_file
用于输出html图片;
导入showfrom bokeh.io import show
用于输出图片;
output_file(“图片名称.html”);
f=figure() 创建figure;
f.line(x,y) 传入x数组,y数组,绘制线型图(rectangle 方块点,circle 圆圈点);
show(f) 输出figure;
#making a basic Boken line Graph
#importing Bokeh
from bokeh.plotting import figure
#容器 figure
from bokeh.io import output_file,show
#prepare some data
x=[1,2,3,4,5]
y=[6,7,8,9,10] #同样长度
#prepare the output file
output_file("Line.html") #被创建的名称
#create figure object
f=figure() #figure
#create Line plot
f.line(x,y) #传入x,y #line
#f.circle(x,y)
#write the plot in the figure object
show(f) #显示figure
Bokeh+numpyarray 建图
传入csv文件建立numpyarraydf=pandas.read_csv()
;
x为df[‘x’]的series,即array的一个column;
同样赋值y;
后续将x,y赋予figure即可;
#making a basic Boken line Graph
#importing Bokeh
from bokeh.plotting import figure
#容器 figure
from bokeh.io import output_file,show
import pandas
#prepare some data
#x=[1