[yt-svn] commit/yt: MatthewTurk: Hotfix for when Matplotlib default backend is not available.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Sep 5 11:36:53 PDT 2013


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/994425eb17ef/
Changeset:   994425eb17ef
Branch:      yt
User:        MatthewTurk
Date:        2013-09-05 15:56:28
Summary:     Hotfix for when Matplotlib default backend is not available.
Affected #:  1 file

diff -r c9a2fa37eb0f352033320807ed3b285c57a3914e -r 994425eb17ef80372efb8f63e73be209f9a0edb9 yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -181,6 +181,7 @@
     # Matplotlib has very nice backend overriding.
     # We should really use that.  This is just a hack.
     import matplotlib
+    matplotlib.use("agg") # Hotfix for when we import pylab below
     new_agg = imp.new_module("reason_agg")
     import matplotlib.backends.backend_agg as bagg
     new_agg.__dict__.update(bagg.__dict__)
@@ -190,8 +191,8 @@
     sys.modules["reason_agg"] = new_agg
     bagg.draw_if_interactive = reason_draw_if_interactive
     from matplotlib._pylab_helpers import Gcf
-    import pylab, matplotlib
     matplotlib.rcParams["backend"] = "module://reason_agg"
+    import pylab
     pylab.switch_backend("module://reason_agg")
 
 _startup_template = r"""\

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list