import bqplot as bq
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
x = np.linspace(0,10,100)
y = np.sin(x)
y[20]=-9.9
plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x8a4f7f0>]
y = np.ma.masked_equal(y, -9.9)
plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x8f078d0>]
sc_x = bq.LinearScale()
sc_y = bq.LinearScale()
series = bq.Lines(x=x, y=y, scales={'x': sc_x, 'y': sc_y})
ax_x = bq.Axis(scale=sc_x)
ax_y = bq.Axis(scale=sc_y, orientation='vertical')
figure = bq.Figure(marks=[series], axes=[ax_x, ax_y])
figure.layout.height = '300px'
figure.layout.width = '500px'
figure
Failed to display Jupyter Widget of type Figure
.
If you're reading this message in Jupyter Notebook or JupyterLab, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another notebook frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.