The behavior of the '.' marker seems anomalous, very
> different between gtkAgg and postscript backends, and not
> very useful:
Hi Eric,
All of your suggestions for '.' are totally reasonable. Perhaps you
can implement it? After implementing much of the contouring and
masked array support, I think you'll find this one relatively
painless.
A few things to be aware of:
* the PS and *Agg backends should not be different. A few months
ago I suggested a new API for backend drawing which added the
method renderer.draw_markers (search the dev list for
draw_markers). Most of the backends have not implemented it yet,
which is why we have conditionals in lines.py like
def _draw_point(self, renderer, gc, xt, yt):
if self._newstyle:
rgbFace = self._get_rgb_face()
path = agg.path_storage()
path.move_to(-0.5, -0.5)
path.line_to(-0.5, 0.5)
path.line_to(0.5, 0.5)
path.line_to(0.5, -0.5)
renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
else:
for (x,y) in zip(xt, yt):
renderer.draw_arc(gc, None, x, y, 1, 1, 0.0, 360.0)
_draw_point is the function that draws the marker style '.' -- see
the Line2D._markers dictionary.
I suggest you modify _draw_point to work like you suggest, for
both the "newstyle" and old cases. "newstyle" is a boolean which
is True iff renderer.draw_markers is implemented (Agg only, I
think). One of the main reasons I implemented draw_markers was to
avoid the overhead of calling a renderer draw function for each
marker. As note in the release notes at
http://matplotlib.sourceforge.net/whats_new.html, these changes
were introduced in mpl 0.72 and can be 20x faster for large
numbers of points (eg 500K points).
* matplotlib already has marker style ',' for draw_pixel, and so
your interpretation of draw_point is fine. When someone wants a
pixel, they can call plot(x, y, ',')
Let me know if you have any more comments or questions.
Thanks,
JDH