[yt-svn] commit/yt-3.0: scopatz: Bugfix for saving plots.

Bitbucket commits-noreply at bitbucket.org
Tue Oct 16 11:15:27 PDT 2012


1 new commit in yt-3.0:


https://bitbucket.org/yt_analysis/yt-3.0/changeset/1c467764bc9d/
changeset:   1c467764bc9d
branch:      yt-3.0
user:        scopatz
date:        2012-10-16 20:15:13
summary:     Bugfix for saving plots.
affected #:  1 file

diff -r ca72ec02ebfe219c6a9b8d055de7095ba6fb7323 -r 1c467764bc9dbbe5a2a97b087b27251df5c544dd yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -891,11 +891,13 @@
         >>> slc.save(mpl_kwargs={'bbox_inches':'tight'})
 
         """
+        if mpl_kwargs is None:
+            mpl_kwargs = {}
         if name == None:
             name = str(self.pf)
         elif name.endswith('.png'):
-            return v.save(name)
-        if mpl_kwargs is None: mpl_kwargs = {}
+            #import pdb; pdb.set_trace()
+            return self.plots.values()[0].save(name, mpl_kwargs)
         axis = axis_names[self.data_source.axis]
         weight = None
         type = self._plot_type
@@ -903,7 +905,8 @@
             weight = self.data_source.weight_field
         names = []
         for k, v in self.plots.iteritems():
-            if isinstance(k, types.TupleType): k = k[1]
+            if isinstance(k, types.TupleType):
+                k = k[1]
             if axis:
                 n = "%s_%s_%s_%s" % (name, type, axis, k)
             else:

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

--

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