[yt-svn] commit/yt: ngoldbaum: Merged in mzingale/yt/yt-3.0 (pull request #923)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jun 4 08:42:30 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/6238acba7afa/
Changeset: 6238acba7afa
Branch: yt-3.0
User: ngoldbaum
Date: 2014-06-04 17:42:21
Summary: Merged in mzingale/yt/yt-3.0 (pull request #923)
Option for a figure to not be cleared by show_mpl() to allow for annotations
Affected #: 1 file
diff -r d891a87e20d3afc80819da0c038a657169b43d1c -r 6238acba7afaf2ce49353f3305fc6511f90fa9f0 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -620,13 +620,13 @@
label = '$\\rm{log}\\/ $' + label
self.transfer_function.vert_cbar(ax=cb.ax, label=label)
- def show_mpl(self, im, enhance=True):
+ def show_mpl(self, im, enhance=True, clear_fig=True):
if self._pylab is None:
import pylab
self._pylab = pylab
if self._render_figure is None:
self._render_figure = self._pylab.figure(1)
- self._render_figure.clf()
+ if clear_fig: self._render_figure.clf()
if enhance:
nz = im[im > 0.0]
@@ -642,9 +642,9 @@
def draw(self):
self._pylab.draw()
- def save_annotated(self, fn, image, enhance=True, dpi=100):
+ def save_annotated(self, fn, image, enhance=True, dpi=100, clear_fig=True):
image = image.swapaxes(0,1)
- ax = self.show_mpl(image, enhance=enhance)
+ ax = self.show_mpl(image, enhance=enhance, clear_fig=clear_fig)
self.annotate(ax.axes, enhance)
self._pylab.savefig(fn, bbox_inches='tight', facecolor='black', dpi=dpi)
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