Sharedbokeh-plots.ipynbOpen in CoCalc
Author: Harald Schilly
Views : 50

Bokeh in CoCalc (Python 3 system-wide kernel)

In [1]:
import sys sys.version
'3.6.8 (default, Aug 20 2019, 17:12:48) \n[GCC 8.3.0]'
In [2]:
import bokeh bokeh.__version__
'1.3.4'
In [3]:
from bokeh.io import output_notebook from bokeh.plotting import show, figure output_notebook()
Loading BokehJS ...
(not running untrusted Javascript)
In [4]:
import numpy as np np.__version__
'1.17.2'
In [5]:
import matplotlib matplotlib.__version__
'3.1.1'
In [6]:
import matplotlib.pyplot as plt
In [8]:
x = np.linspace(-3, 3, 201) f = lambda x: x**4 - 2 * x**3 + 3 * x**2 + 2 * x + 1 f2 = lambda x: 30 * np.sin(x) * x y = f(x) y2 = f2(x) fig = figure(plot_width=600, plot_height=400) fig.line(x, y, line_width=2) fig.line(x, y2, line_width=1, color="green") fig.xaxis.axis_label = "x" fig.yaxis.axis_label = "y" show(fig)
(not running untrusted Javascript)
In [ ]: