astrofrog/rasterized_scatter — Issue #2: matplotlib markers?
Author: mdboom
Created: 2011-10-20 16:17:30+00:00
State: open

Have you considered using markers for this? Replacing the rasterized scatter calls in example.py with:

ax.plot(x, y, '+', markersize=2, markeredgecolor='red', antialiased=False)

runs in about 2.1s, on my machine. rasterized_scatter runs in about 1.9s, so it is slightly faster, but not by much.

The interactive performance of matplotlib markers is actually better because it isn't reallocating an image buffer on each pan and zoom.

About the only time to use scatter over marker is when the size of the symbol changes with each instance.

If rasterized output in the file is what you want, you can call "set_rasterized(True)" on the Line2D objects.