|
From: <md...@us...> - 2008-09-25 13:46:09
|
Revision: 6121
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6121&view=rev
Author: mdboom
Date: 2008-09-25 13:46:00 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
Fix double rendering when saving PNGs with Agg backend.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-09-24 09:21:41 UTC (rev 6120)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-09-25 13:46:00 UTC (rev 6121)
@@ -308,8 +308,6 @@
renderer.dpi = self.figure.dpi
if is_string_like(filename_or_obj):
filename_or_obj = file(filename_or_obj, 'wb')
- renderer = self.get_renderer()
- x = renderer._renderer.buffer_rgba(0, 0)
_png.write_png(renderer._renderer.buffer_rgba(0, 0),
renderer.width, renderer.height,
filename_or_obj, self.figure.dpi)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-02 15:32:12
|
Revision: 6467
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6467&view=rev
Author: mdboom
Date: 2008-12-02 15:32:07 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
Be more conservative about chunking large paths -- filled paths shouldn't be chunked -- or at least would require a more complex algorithm.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-12-02 15:27:23 UTC (rev 6466)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-12-02 15:32:07 UTC (rev 6467)
@@ -79,7 +79,7 @@
def draw_path(self, gc, path, transform, rgbFace=None):
nmax = rcParams['agg.path.chunksize'] # here at least for testing
npts = path.vertices.shape[0]
- if nmax > 100 and npts > nmax and path.should_simplify:
+ if nmax > 100 and npts > nmax and path.should_simplify and rgbFace is None:
nch = npy.ceil(npts/float(nmax))
chsize = int(npy.ceil(npts/nch))
i0 = npy.arange(0, npts, chsize)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-03-27 21:11:15
|
Revision: 7008
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7008&view=rev
Author: jdh2358
Date: 2009-03-27 21:11:07 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
moved agg caches to instance namespace for thread safety
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-03-27 21:10:24 UTC (rev 7007)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-03-27 21:11:07 UTC (rev 7008)
@@ -46,11 +46,12 @@
context instance that controls the colors/styles
"""
debug=1
- texd = maxdict(50) # a cache of tex image rasters
- _fontd = maxdict(50)
def __init__(self, width, height, dpi):
if __debug__: verbose.report('RendererAgg.__init__', 'debug-annoying')
RendererBase.__init__(self)
+ self.texd = maxdict(50) # a cache of tex image rasters
+ self._fontd = maxdict(50)
+
self.dpi = dpi
self.width = width
self.height = height
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2010-07-02 23:03:51
|
Revision: 8489
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8489&view=rev
Author: ryanmay
Date: 2010-07-02 23:03:44 +0000 (Fri, 02 Jul 2010)
Log Message:
-----------
Clean up docstring of restore_region().
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-07-02 22:44:27 UTC (rev 8488)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-07-02 23:03:44 UTC (rev 8489)
@@ -269,11 +269,11 @@
def restore_region(self, region, bbox=None, xy=None):
"""
- restore the saved region. if bbox (instance of BboxBase, or
+ Restore the saved region. If bbox (instance of BboxBase, or
its extents) is given, only the region specified by the bbox
will be restored. *xy* (a tuple of two floasts) optionally
- specify the new position (of the LLC of the originally region,
- not the LLC of the bbox) that the region will be restored.
+ specifies the new position (the LLC of the original region,
+ not the LLC of the bbox) where the region will be restored.
>>> region = renderer.copy_from_bbox()
>>> x1, y1, x2, y2 = region.get_extents()
@@ -445,4 +445,3 @@
renderer.width, renderer.height,
filename_or_obj, self.figure.dpi)
renderer.dpi = original_dpi
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-12-29 03:01:16
|
Revision: 8849
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8849&view=rev
Author: leejjoon
Date: 2010-12-29 03:01:10 +0000 (Wed, 29 Dec 2010)
Log Message:
-----------
make RendererAgg.draw_path_collection as a wrapper function
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-12-29 03:00:36 UTC (rev 8848)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-12-29 03:01:10 UTC (rev 8849)
@@ -75,15 +75,18 @@
else:
return LOAD_NO_HINTING
+ # for filtering to work with rasterization, methods needs to be wrapped.
+ # maybe there is better way to do it.
def draw_markers(self, *kl, **kw):
- # for filtering to work with rastrization, methods needs to be wrapped.
- # maybe there is better way to do it.
return self._renderer.draw_markers(*kl, **kw)
+ def draw_path_collection(self, *kl, **kw):
+ return self._renderer.draw_path_collection(*kl, **kw)
+
def _update_methods(self):
#self.draw_path = self._renderer.draw_path # see below
#self.draw_markers = self._renderer.draw_markers
- self.draw_path_collection = self._renderer.draw_path_collection
+ #self.draw_path_collection = self._renderer.draw_path_collection
self.draw_quad_mesh = self._renderer.draw_quad_mesh
self.draw_gouraud_triangle = self._renderer.draw_gouraud_triangle
self.draw_gouraud_triangles = self._renderer.draw_gouraud_triangles
@@ -326,6 +329,10 @@
post_processing is plotted (using draw_image) on it.
"""
+ # WARNING.
+ # For agg_filter to work, the rendere's method need
+ # to overridden in the class. See draw_markers, and draw_path_collections
+
from matplotlib._image import fromarray
width, height = int(self.width), int(self.height)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|