From: <jd...@us...> - 2008-06-21 05:59:36
|
Revision: 5620 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5620&view=rev Author: jdh2358 Date: 2008-06-20 11:42:28 -0700 (Fri, 20 Jun 2008) Log Message: ----------- added a note to self Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/figure.py trunk/matplotlib/lib/matplotlib/image.py Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 17:23:55 UTC (rev 5619) +++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 18:42:28 UTC (rev 5620) @@ -211,7 +211,11 @@ *figurePatch* a :class:`matplotlib.patches.Rectangle` instance - + *suppressComposite + for multiple figure images, the figure will make composite + images depending on the renderer option_image_nocomposite + function. If suppressComposite is True|False, this will + override the renderer """ def __str__(self): @@ -278,7 +282,6 @@ self._axstack = Stack() # maintain the current axes self.axes = [] self.clf() - self._cachedRenderer = None def _get_dpi(self): @@ -328,6 +331,7 @@ def get_children(self): 'get a list of artists contained in the figure' children = [self.figurePatch] + children.extend(self.artists) children.extend(self.axes) children.extend(self.lines) children.extend(self.patches) @@ -755,7 +759,7 @@ """ Clear the figure """ - + self.suppressComposite = None self.callbacks = cbook.CallbackRegistry(('dpi_changed', )) for ax in tuple(self.axes): # Iterate over the copy. @@ -767,6 +771,7 @@ toolbar.update() self._axstack.clear() self._seen = {} + self.artists = [] self.lines = [] self.patches = [] self.texts=[] @@ -791,16 +796,23 @@ if self.frameon: self.figurePatch.draw(renderer) + # todo: respect zorder for p in self.patches: p.draw(renderer) for l in self.lines: l.draw(renderer) + for a in self.artists: a.draw(renderer) + + # override the renderer default if self.suppressComposite + # is not None + composite = renderer.option_image_nocomposite() + if self.suppressComposite is not None: + composite = self.suppressComposite - if len(self.images)<=1 or renderer.option_image_nocomposite() or not allequal([im.origin for im in self.images]): + if len(self.images)<=1 or composite or not allequal([im.origin for im in self.images]): for im in self.images: im.draw(renderer) else: # make a composite image blending alpha # list of (_image.Image, ox, oy) - mag = renderer.get_image_magnification() ims = [(im.make_image(mag), im.ox*mag, im.oy*mag) for im in self.images] Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2008-06-20 17:23:55 UTC (rev 5619) +++ trunk/matplotlib/lib/matplotlib/image.py 2008-06-20 18:42:28 UTC (rev 5620) @@ -656,7 +656,9 @@ def draw(self, renderer, *args, **kwargs): if not self.get_visible(): return + # todo: we should be able to do some cacheing here im = self.make_image() + renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox, *self.get_transformed_clip_path_and_affine()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |