IPython support
We have already used IPython throughout the chapter, and we saw how useful it is. Therefore, we want to give it a better introduction.
Matplotlib tends to defer drawing till the end, since it's an expensive operation, and updating the plot at every property change would slow down the execution.
That's fine for batch operations, but when we're working with the Python shell, we want to see updates at every command we type. Easy to say, but difficult to implement.
Most GUI libraries need to control the main loop of execution of Python, thus preventing any further interaction (that is, you can't type while viewing the image). The only GUI that plays nice with Python's standard shell is Tkinter.
Note
Tkinter is the standard Python interface to the Tk GUI library.
So you might want to set the backend
property to TkAgg
and interactive
to True
when using the Python interpreter interactively.
IPython uses a smart method to handle this situation—it spawns a thread to execute GUI library...