[yt-svn] commit/yt: ngoldbaum: Merged in jwise77/yt (pull request #1963)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jan 27 09:10:36 PST 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/0522add7213b/
Changeset:   0522add7213b
Branch:      yt
User:        ngoldbaum
Date:        2016-01-27 17:10:31+00:00
Summary:     Merged in jwise77/yt (pull request #1963)

[BUGFIX] Removing large margins in eps_writer figures
Affected #:  1 file

diff -r ad95e4751bb23b3a958b77d67ff779c5546c60f1 -r 0522add7213b7a461a68756692177872680b6027 yt/visualization/eps_writer.py
--- a/yt/visualization/eps_writer.py
+++ b/yt/visualization/eps_writer.py
@@ -522,7 +522,12 @@
                 self.field = plot.data_source._determine_fields(field)[0]
             if self.field not in plot.plots.keys():
                 raise RuntimeError("Field '%s' does not exist!" % str(self.field))
-            plot.plots[self.field].hide_colorbar()
+            if isinstance(plot, PlotWindow):
+                plot.hide_colorbar()
+                plot.hide_axes()
+            else:
+                plot.plots[self.field]._toggle_axes(False)
+                plot.plots[self.field]._toggle_colorbar(False)
             plot.refresh()
             _p1 = plot.plots[self.field].figure
             force_square = True
@@ -538,16 +543,13 @@
         else:
             raise RuntimeError("Unknown plot type")
 
-        _p1.axes[0].set_axis_off()  # remove axes
         _p1.axes[0].set_position([0,0,1,1])  # rescale figure
         _p1.set_facecolor('w')  # set background color
         figure_canvas = FigureCanvasAgg(_p1)
         figure_canvas.draw()
         size = (_p1.get_size_inches() * _p1.dpi).astype('int')
 
-        # Account for 1 pixel line width of the axis box and
-        # non-square images after removing the colorbar.
-        yshift = -1.0 / _p1.dpi * 2.54
+        # Account for non-square images after removing the colorbar.
         scale *= 1.0 - 1.0 / (_p1.dpi * self.figsize[0])
         if force_square:
             yscale = scale * float(size[1]) / float(size[0])
@@ -555,7 +557,7 @@
             yscale = scale
         image = pyx.bitmap.image(size[0], size[1], "RGB",
                                  figure_canvas.tostring_rgb())
-        self.canvas.insert(pyx.bitmap.bitmap(pos[0], pos[1]+yshift, image,
+        self.canvas.insert(pyx.bitmap.bitmap(pos[0], pos[1], image,
                                              width=scale*self.figsize[0],
                                              height=yscale*self.figsize[1]))
 
@@ -1336,7 +1338,7 @@
     d = DualEPS(figsize=figsize)
     d.insert_image_yt(plot, field=field)
     d.axis_box_yt(plot, bare_axes=bare_axes, **kwargs)
-    if colorbar:
+    if colorbar and not isinstance(plot, ProfilePlot):
         d.colorbar_yt(plot, orientation=cb_orient)
     if savefig is not None:
         d.save_fig(savefig, format=file_format)

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