Rafael Neves
Rafael Neves

Reputation: 467

Plots and widgets not showing on jupyter lab

If I run this code on a jupyter notebook

from bqplot import pyplot as plt
import numpy as np

plt.figure(1, title='Line Chart')
np.random.seed(0)
n = 200
x = np.linspace(0.0, 10.0, n)
y = np.cumsum(np.random.randn(n))
plt.plot(x, y)
plt.show()

The plot display, but if I run the same code on Jupyter lab I get

VBox(children=(Figure(axes=[Axis(scale=LinearScale()), Axis(orientation='vertical', scale=LinearScale())], fig…

How do I fix this?

Upvotes: 0

Views: 3408

Answers (2)

Ransaka Ravihara
Ransaka Ravihara

Reputation: 1994

First, run this.

$ pip install bqplot
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager 
$ jupyter labextension install bqplot

In a Jupyter notebook

import bqplot

Then restart jupyter lab. You are ready to go!

Upvotes: 3

jimmie_roggers
jimmie_roggers

Reputation: 173

Hi just type this in a cell and then run it, it should work!

%matplotlib inline

Upvotes: 0

Related Questions