================== Bqplot Example ================== Thebe can display output from bqplot_ Jupyter widgets, a 2D plotting library. This example_ is repurposed from the bqplot documentation and is licensed under the Apache License 2.0 License. .. _bqplot: https://github.com/bqplot/bqplot .. _example: https://github.com/bqplot/bqplot/blob/master/examples/Introduction.ipynb Setup ===== Be sure to load require.min.js and Font Awesome 4 before any of your thebe activation code, it is required for the bqplot widget and navigation icons to work: .. code-block:: html Configure thebe and load it: .. code-block:: html Create a button to activate thebe: .. code-block:: html Now add code cells between these HTML tags: .. code-block:: html
Example ======= .. raw:: html Press the "Activate" button below to connect to a Jupyter server: .. raw:: html Here we will display a basic 2D plot: .. raw:: htmlimport numpy as np from bqplot import pyplot as plt size = 100 np.random.seed(0) x_data = np.arange(size) y_data = np.cumsum(np.random.randn(size) * 100.0) plt.figure(title='My First Plot') plt.plot(x_data, y_data) plt.show()