sooon - 1 year ago 202

Python Question

I just started to use

`Jupiter Notebook`

`Python`

`matplotlib`

`import numpy as np`

import matplotlib.pyplot as plt

plt.plot([1,2,3,4])

plt.ylabel('some numbers')

plt.show()

The kernel just keep running and nothing happen. How to resolve this? Is there an dependency issue? My newly installed

`matplotlib`

`python`

`numpy`

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

To Visualize the plots created by the matplotlib in **Jupiter Notebook or ipython notebook** you have add one extra line at the beginning.

```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```

If your matplotlib **version is above 1.4, and you are using IPython 3.x** you have to use the below code.

```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
```

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**