0

NOT DUPLICATE OF How to make IPython notebook matplotlib plot inline
I tried restarting kernel, using both %matplotlib inline twice/once ,and %matplotlib notebook twice/once, no change.

Reinstalled anaconda, tried plt.show(); (; at end) as well, no change.

plt.savefig("test.png")

saves graph picture beautifully, so it works in the backend.

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

t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2*np.pi*t)
plt.plot(t, s)

plt.show()

With %matplotlib notebook it displays a big blank, but hovering my mouse over displays the coordinates in the bottom right corner.

I have Windows 10, Python is 3.7.3, matplotlib 3.1.0, ipykernel 5.1.1, ipython 6.5.0, Jupyter Notebook server 6.0.0.

when using %matplotlib notebook, I can interact with it, so hovering my mouse over it displays the x and y coordinates on the bottom right corner %matplotlib notebook twice

Chris
  • 557
  • 4
  • 17
  • Can you show an attempt where you use `%matplotlib notebook` twice. [this is](https://i.stack.imgur.com/EJPZo.png) how it should look like, and it does work as expected. If it doesn't for you, you may need to provide more information about your libraries and system. – ImportanceOfBeingErnest Aug 14 '19 at 17:36
  • It works as expected for me. – vb_rises Aug 14 '19 at 17:40
  • What exactly should I check about the libraries? – Chris Aug 14 '19 at 17:46
  • 1
    For example my result was produced with python 3.6.6, juypter notebook server 5.6, IPython 6.5.0, ipykernel 5.1.0 and matplotlib 3.1.0, with the notebook running in Firefox 68 on a windows 8.1 computer. – ImportanceOfBeingErnest Aug 14 '19 at 18:05
  • Python is 3.7, matplotlib 3.1, ipykernel 5.1.1, ipython 7.6.1, jupyter 1.0, jupyter-client 5.3.1. Dont see any jupyter notebook server package explicitly – Chris Aug 14 '19 at 18:21
  • Python is 3.7,3 matplotlib 3.1, ipykernel 5.1.1, ipython 6.5.0, jupyter 1.0, jupyter-client 5.3.1. Notebook sever 6.0.0. Strange because ipythonis 7.6.1 in Pycharm, but when clicking on About in Jupyter notebook, its 6.5.0 – Chris Aug 14 '19 at 18:28
  • I suggest to add this information in the question and delete it in the comments. Are you running this in PyCharm? Or jupyter notebook (or is pycharm calling jupyter notebook?) In any case it would be good to test without PyCharm! You can always find out the versions you are actually using by `print(.__version__)`. – ImportanceOfBeingErnest Aug 14 '19 at 18:38

1 Answers1

0

I was using Internet Explorer. Opened same Jupyter workbook in Edge, and it works!

Chris
  • 557
  • 4
  • 17