[Yt-svn] commit/yt: MatthewTurk: This modification should correctly override existing (interactive) backends for

Bitbucket commits-noreply at bitbucket.org
Wed Apr 27 17:27:04 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/86ed7890efd5/
changeset:   r4219:86ed7890efd5
branch:      yt
user:        MatthewTurk
date:        2011-04-28 02:24:49
summary:     This modification should correctly override existing (interactive) backends for
matplotlib.  Unfortunately, the backend is set by default on first import of a
backend, and that is difficult to get around within the context of the command
line utility.

It may be the case that moving to a dedicated command line tool, 'reason' for
instance, will get around this.
affected #:  1 file (81 bytes)

--- a/yt/gui/reason/extdirect_repl.py	Wed Apr 27 19:54:20 2011 -0400
+++ b/yt/gui/reason/extdirect_repl.py	Wed Apr 27 20:24:49 2011 -0400
@@ -129,6 +129,7 @@
             _canvas_deliver(manager.canvas)
     # Matplotlib has very nice backend overriding.
     # We should really use that.  This is just a hack.
+    import matplotlib
     new_agg = imp.new_module("reason_agg")
     import matplotlib.backends.backend_agg as bagg
     new_agg.__dict__.update(bagg.__dict__)
@@ -139,6 +140,7 @@
     bagg.draw_if_interactive = reason_draw_if_interactive
     from matplotlib._pylab_helpers import Gcf
     import pylab, matplotlib
+    matplotlib.rcParams["backend"] = "module://reason_agg"
     pylab.switch_backend("module://reason_agg")
 
 class ExtDirectREPL(ProgrammaticREPL, BottleDirectRouter):

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