[yt-svn] commit/yt: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jul 9 08:59:03 PDT 2014


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/37a82a7c88da/
Changeset:   37a82a7c88da
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-07 23:53:00
Summary:     Adding repr_html to PlotWindowWCS
Affected #:  1 file

diff -r 92e343ce7927343b06b78443260c0ea4f2c6b3a1 -r 37a82a7c88da56e1987ed5cf211cdd6ccec2eaf3 yt/frontends/fits/misc.py
--- a/yt/frontends/fits/misc.py
+++ b/yt/frontends/fits/misc.py
@@ -11,6 +11,8 @@
 #-----------------------------------------------------------------------------
 
 import numpy as np
+import base64
+from yt.extern.six.moves import StringIO
 from yt.fields.derived_field import ValidateSpatial
 from yt.utilities.on_demand_imports import _astropy
 from yt.funcs import mylog, get_image_suffix
@@ -187,3 +189,14 @@
             mpl_kwargs = {}
         mpl_kwargs["bbox_inches"] = "tight"
         self.pw.save(name=name, mpl_kwargs=mpl_kwargs)
+
+    def _repr_html_(self):
+        ret = ''
+        for k, v in self.plots.iteritems():
+            canvas = FigureCanvasAgg(v)
+            f = StringIO()
+            canvas.print_figure(f)
+            f.seek(0)
+            img = base64.b64encode(f.read())
+            ret += '<img src="data:image/png;base64,%s"><br>' % img
+        return ret


https://bitbucket.org/yt_analysis/yt/commits/9f48b7a0d7c9/
Changeset:   9f48b7a0d7c9
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-07 23:59:57
Summary:     Be slightly more generous in leaving space for bulky axes.
Affected #:  1 file

diff -r 37a82a7c88da56e1987ed5cf211cdd6ccec2eaf3 -r 9f48b7a0d7c9d0089e4d5bb425dc634cd49be6bd yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1697,7 +1697,7 @@
         else:
             fsize = figure_size
         self._cb_size = 0.0375*fsize
-        self._ax_text_size = [0.9*fontscale, 0.7*fontscale]
+        self._ax_text_size = [1.2*fontscale, 0.9*fontscale]
         self._top_buff_size = 0.30*fontscale
         self._aspect = ((extent[1] - extent[0])/(extent[3] - extent[2]))
 


https://bitbucket.org/yt_analysis/yt/commits/e5aea225aecf/
Changeset:   e5aea225aecf
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-08 00:04:06
Summary:     Making use of _repr_html_ in PlotWindowWCS in the docs.
Affected #:  1 file

diff -r 9f48b7a0d7c9d0089e4d5bb425dc634cd49be6bd -r e5aea225aecf96a8a570381ce461644133bb9b37 doc/source/cookbook/fits_radio_cubes.ipynb
--- a/doc/source/cookbook/fits_radio_cubes.ipynb
+++ b/doc/source/cookbook/fits_radio_cubes.ipynb
@@ -81,8 +81,7 @@
      "collapsed": false,
      "input": [
       "from yt.frontends.fits.misc import PlotWindowWCS\n",
-      "wcs_slc = PlotWindowWCS(slc)\n",
-      "wcs_slc[\"intensity\"]"
+      "PlotWindowWCS(slc)\n"
      ],
      "language": "python",
      "metadata": {},


https://bitbucket.org/yt_analysis/yt/commits/c6b09204f3e7/
Changeset:   c6b09204f3e7
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-08 00:15:30
Summary:     Make PlotWindowWCS.show() an alias for _repr_html_
Affected #:  1 file

diff -r e5aea225aecf96a8a570381ce461644133bb9b37 -r c6b09204f3e728a7d3611ffc16a962ad037ddbee yt/frontends/fits/misc.py
--- a/yt/frontends/fits/misc.py
+++ b/yt/frontends/fits/misc.py
@@ -179,10 +179,7 @@
                 return self.plots[k]
 
     def show(self):
-        from IPython.core.display import display
-        for k, v in sorted(self.plots.iteritems()):
-            canvas = FigureCanvasAgg(v)
-            display(v)
+        return self
 
     def save(self, name=None, mpl_kwargs=None):
         if mpl_kwargs is None:

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