[Yt-svn] yt: Updating call to FigureCanvas to the Agg version. Removed some

hg at spacepope.org hg at spacepope.org
Fri Feb 4 10:59:56 PST 2011


hg Repository: yt
details:   yt/rev/96b6bb259d78
changeset: 3714:96b6bb259d78
user:      John Wise <jwise at astro.princeton.edu>
date:
Fri Feb 04 13:57:55 2011 -0500
description:
Updating call to FigureCanvas to the Agg version.  Removed some
debugging statements and a temporary image.

diffstat:

 yt/visualization/eps_writer.py |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 01afdaebaaa2 -r 96b6bb259d78 yt/visualization/eps_writer.py
--- a/yt/visualization/eps_writer.py	Wed Feb 02 22:41:09 2011 -0500
+++ b/yt/visualization/eps_writer.py	Fri Feb 04 13:57:55 2011 -0500
@@ -29,6 +29,7 @@
 import pyx
 import numpy as na
 from matplotlib import cm
+from _mpl_imports import FigureCanvasAgg
 
 from yt.utilities.definitions import \
     x_dict, x_names, \
@@ -389,12 +390,12 @@
         _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 = FigureCanvas(_p1)
+        figure_canvas = FigureCanvasAgg(_p1)
         figure_canvas.draw()
         size = _p1.get_size_inches() * _p1.dpi
         image = pyx.bitmap.image(size[0], size[1], "RGB",
                                  figure_canvas.tostring_rgb())
-        figure_canvas.print_png('test.png')
+        #figure_canvas.print_png('test.png')
         self.canvas.insert(pyx.bitmap.bitmap(pos[0], pos[1], image,
                                              width=self.figsize[0],
                                              height=self.figsize[1]))
@@ -547,9 +548,7 @@
             proj = "Proj" in plot._type_name and \
                    plot.data._weight is None
             _zlabel = plot.pf.field_info[plot.axis_names["Z"]].get_label(proj)
-            print _zlabel
             _zlabel = _zlabel.replace("_","\;")
-            print _zlabel
             _zlog = plot.log_field
         else:
             _zlabel = plot._z_label.replace("_","\;")



More information about the yt-svn mailing list