1
votes

I'm running Python 3.5.1 with matplotlib version 1.5.1 and iPython 5.0.0. I can't seem to get matplotlib's interactive feature working. I can run a command to create a plot:

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1,2,3])

This doesn't show a figure until I manually execute plt.show(), at which point iPython hangs until I close the figure window. I have interactive set to True in my matplotlibrc file.

It's been a year or so since I used matplotlib. The last time I used it, I got interactive without having to execute plt.show(). Has something changed or am I doing something wrong?

1
For those not too familiar with matplotlib, what do you mean by interactive. you want the console to "not freeze" after the plot shows? Or you expect to "interact" with the plot window somehow? And how? - Tasos Papastylianou
@TasosPapastylianou It allows you to add data and manipulate the plot after it is created, by just continuing to use the object, and you should be able to see these changes dynamically on the figure window - pretzlstyle
there is an option you can pass to show() from what I remember, which stops it from freezing the console. I'll install the module and I'll let you know what it is, because I can't remember it by heart. - Tasos Papastylianou
the argument is block. i.e. pyplot.show(block=False) - Tasos Papastylianou

1 Answers

2
votes

You were probably using interactive mode previously.

Start ipython with:

ipython --pylab

Then your plots will show up instantly.