Skip to content

Commit 732d62b

Browse files
committed
Another attempt at getting pixel markers to work correctly.
1 parent 8ca2879 commit 732d62b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/matplotlib/lines.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,11 @@ def draw(self, renderer):
547547
marker_path = marker.get_path()
548548
marker_trans = marker.get_transform()
549549
w = renderer.points_to_pixels(self._markersize)
550-
if marker.get_marker() != ',': # Don't scale for pixels
550+
if marker.get_marker() != ',':
551+
# Don't scale for pixels, and don't stroke them
551552
marker_trans = marker_trans.scale(w)
553+
else:
554+
gc.set_linewidth(0)
552555
renderer.draw_markers(
553556
gc, marker_path, marker_trans, subsampled, affine.frozen(),
554557
rgbFace)

lib/matplotlib/markers.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,8 @@ def _set_circle(self, reduction = 1.0):
280280

281281
def _set_pixel(self):
282282
self._path = Path.unit_rectangle()
283-
self._transform = Affine2D().translate(-0.5, -0.5) \
284-
.scale(0.5, 0.5).translate(0.5, 0.5)
283+
self._transform = Affine2D().translate(-0.49999, -0.50001)
285284
self._snap_threshold = False
286-
self._joinstyle = 'miter'
287285

288286
def _set_point(self):
289287
self._set_circle(reduction = self._point_size_reduction)

src/_backend_agg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ RendererAgg::draw_markers(const Py::Tuple& args)
660660
// Deal with the difference in y-axis direction
661661
marker_trans *= agg::trans_affine_scaling(1.0, -1.0);
662662
trans *= agg::trans_affine_scaling(1.0, -1.0);
663-
trans *= agg::trans_affine_translation(0.5, (double)height+0.5);
663+
trans *= agg::trans_affine_translation(0.0, (double)height);
664664

665665
PathIterator marker_path(marker_path_obj);
666666
transformed_path_t marker_path_transformed(marker_path, marker_trans);

0 commit comments

Comments
 (0)