sunpy/sunpy — Issue #85: Matplotlib windows opened unexpectedly when running in ipython with --pylab
Author: mattearnshaw
Created: 2011-10-19 19:52:36+00:00
State: open

Matplotlib windows are opened unexpectedly when running in ipython with --pylab.
For example

sunpy.Map(sunpy.AIA_171_IMAGE).plot()

or

from sunpy.gui import Plotman
Plotman(sunpy.AIA_171_IMAGE)

will open matplotlib windows where they shouldn't under a "pure" python environment.

This option can be checked for and "fixed" using the following code. Which I would suggest should be added to sunpy/__init__.py

if plt.isinteractive(): plt.ioff()

However, this could cause unexpected behaviour for the user when using other packages, so alternatively it could be turned on/off at the start/end of methods that would cause matplotlib windows to show.