I am getting the following error when I test on svn HEAD
johnh@...539...:misc> python rasterization_demo.py
Traceback (most recent call last):
File "rasterization_demo.py", line 49, in ?
plt.savefig("test_reasterization.eps", dpi=150)
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/pyplot.py",
line 354, in savefig
return fig.savefig(*args, **kwargs)
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/figure.py",
line 1002, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backend_bases.py",
line 1467, in print_figure
bbox_inches_restore=_bbox_inches_restore,
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backend_bases.py",
line 1321, in print_eps
return ps.print_eps(*args, **kwargs)
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py",
line 847, in print_eps
return self._print_ps(outfile, 'eps', *args, **kwargs)
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py",
line 879, in _print_ps
orientation, isLandscape, papertype,
File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py",
line 996, in _print_figure
Ndict += len(renderer.used_characters)
AttributeError: 'MixedModeRenderer' object has no attribute 'used_characters'
Also, a minor potential buglet. In the following,
+ if dsu[0][0] < rasterization_zorder:
+ renderer.start_rasterizing()
+ dsu_rasterized = [l for l in dsu if l[0] < rasterization_zorder]
+ dsu = [l for l in dsu if l[0] >= rasterization_zorder]
+ else:
+ dsu_rasterized = []
I think one could construct a sufficiently empty axes that len(dsu)==0
so I suggest
+ if len(dsu) and dsu[0][0] < rasterization_zorder:
It might also be worthwhile employing a consistent usage when wrapping
the draw methods. We have
+ @allow_rasterization
def draw(self, renderer, *args, **kwargs):
+ @martist.allow_rasterization
def draw(self, renderer):
and
+ @artist.allow_rasterization
def draw(self, renderer):
If we take the time upfront to be consistent, any search replace
things we need to do later will be easier.
Thanks,
JDH
···
On Tue, May 5, 2009 at 1:08 PM, Jae-Joon Lee <lee.j.joon@...149...> wrote:
Any comment or suggestion will be welcomed.
I'm planning to commit this change to the svn soon, unless others come
up with some issues.