CoCalc Public Filesbokeh-plots.ipynbOpen with one click!
Authors: Harald Schilly, ℏal Snyder
Views : 237

Bokeh in CoCalc (Python 3 system-wide kernel)

In [1]:
import sys sys.version
'3.6.9 (default, Apr 18 2020, 01:56:04) \n[GCC 8.4.0]'
In [2]:
import bokeh bokeh.__version__
'1.4.0'
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.18.3'
In [5]:
import matplotlib matplotlib.__version__
'3.2.1'
In [6]:
import matplotlib.pyplot as plt
In [7]:
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 [ ]: