Skip to content

Commit ac68d96

Browse files
committed
draw markers to backend
svn path=/trunk/matplotlib/; revision=939
1 parent 2cdf863 commit ac68d96

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

TODO

+3-1
Original file line numberDiff line numberDiff line change
@@ -684,4 +684,6 @@ square). All displayed area is white.
684684

685685
-- DONE pyparsing a performance bottleneck for log ticks
686686

687-
-- draw point and draw pixel currently broken for new style markers
687+
-- DONE draw point and draw pixel currently broken for new style markers
688+
689+
-- alpha channel in colormaps

lib/matplotlib/lines.py

+28-4
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,36 @@ def _draw_dotted(self, renderer, gc, xt, yt):
548548

549549

550550
def _draw_point(self, renderer, gc, xt, yt):
551-
for (x,y) in zip(xt, yt):
552-
renderer.draw_arc(gc, None, x, y, 1, 1, 0.0, 360.0)
551+
if self._newstyle:
552+
rgbFace = self._get_rgb_face()
553+
CLOSE = self._get_close(rgbFace)
554+
path = (
555+
(MOVETO, -0.5, -0.5),
556+
(LINETO, -0.5, 0.5),
557+
(LINETO, 0.5, 0.5),
558+
(LINETO, 0.5, -0.5),
559+
CLOSE
560+
)
561+
renderer.draw_markers(gc, path, xt, yt, self._transform)
562+
else:
563+
for (x,y) in zip(xt, yt):
564+
renderer.draw_arc(gc, None, x, y, 1, 1, 0.0, 360.0)
553565

554566
def _draw_pixel(self, renderer, gc, xt, yt):
555-
for (x,y) in zip(xt, yt):
556-
renderer.draw_point(gc, x, y)
567+
if self._newstyle:
568+
rgbFace = self._get_rgb_face()
569+
CLOSE = self._get_close(rgbFace)
570+
path = (
571+
(MOVETO, -0.5, -0.5),
572+
(LINETO, -0.5, 0.5),
573+
(LINETO, 0.5, 0.5),
574+
(LINETO, 0.5, -0.5),
575+
CLOSE
576+
)
577+
renderer.draw_markers(gc, path, xt, yt, self._transform)
578+
else:
579+
for (x,y) in zip(xt, yt):
580+
renderer.draw_point(gc, x, y)
557581

558582

559583
def _draw_circle(self, renderer, gc, xt, yt):

0 commit comments

Comments
 (0)