Data Science/시각화

[Bokeh] 꺽은선 그래프 그리기 (Line chart)

상어군 2021. 2. 26. 20:31
반응형

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
from bokeh.io import curdoc
from bokeh.layouts import row
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
 
# Set up data
= 200
= np.linspace(04*np.pi, N)
= np.sin(x)
source = ColumnDataSource(data=dict(x=x, y=y))
 
 
# Set up plot
plot = figure(plot_height=400, plot_width=400, title="my sine wave",
              tools="crosshair,pan,reset,save,wheel_zoom",
              x_range=[04*np.pi], y_range=[-1010])
plot.line('x''y', source=source, line_width=3, line_alpha=0.6)
 
curdoc().add_root(row(plot, width=800))
curdoc().title = "Linechart"
cs

반응형