In [1]:
import bqplot as bq
In [2]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
In [3]:
x = np.linspace(0,10,100)
y = np.sin(x)
y[20]=-9.9
In [4]:
plt.plot(x,y)
Out[4]:
[<matplotlib.lines.Line2D at 0x8a4f7f0>]
In [5]:
y = np.ma.masked_equal(y, -9.9)
In [6]:
plt.plot(x,y)
Out[6]:
[<matplotlib.lines.Line2D at 0x8f078d0>]
In [7]:
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'
In [8]:
figure