diff --git a/lib/matplotlib/tests/baseline_images/test_axes/marker_edges.png b/lib/matplotlib/tests/baseline_images/test_axes/marker_edges.png index a6245e1148d5..077e213e1510 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_axes/marker_edges.png and b/lib/matplotlib/tests/baseline_images/test_axes/marker_edges.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_axes/stackplot_test_baseline.png b/lib/matplotlib/tests/baseline_images/test_axes/stackplot_test_baseline.png index b456f7ad57a8..f59650bd8552 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_axes/stackplot_test_baseline.png and b/lib/matplotlib/tests/baseline_images/test_axes/stackplot_test_baseline.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_text/text_contains.png b/lib/matplotlib/tests/baseline_images/test_text/text_contains.png index 05f6a940bdfd..d5f8b6ea54ff 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_text/text_contains.png and b/lib/matplotlib/tests/baseline_images/test_text/text_contains.png differ diff --git a/src/_backend_agg.h b/src/_backend_agg.h index e87e55d27c27..71458c92ce1c 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -516,6 +516,7 @@ inline void RendererAgg::draw_markers(GCAgg &gc, // Deal with the difference in y-axis direction marker_trans *= agg::trans_affine_scaling(1.0, -1.0); + trans *= agg::trans_affine_scaling(1.0, -1.0); trans *= agg::trans_affine_translation(0.5, (double)height + 0.5); @@ -527,6 +528,13 @@ inline void RendererAgg::draw_markers(GCAgg &gc, points_to_pixels(gc.linewidth)); curve_t marker_path_curve(marker_path_snapped); + if (!marker_path_snapped.is_snapping()) { + // If the path snapper isn't in effect, at least make sure the marker + // at (0, 0) is in the center of a pixel. This, importantly, makes + // the circle markers look centered around the point they refer to. + marker_trans *= agg::trans_affine_translation(0.5, 0.5); + } + transformed_path_t path_transformed(path, trans); nan_removed_t path_nan_removed(path_transformed, false, false); snap_t path_snapped(path_nan_removed, SNAP_FALSE, path.total_vertices(), 0.0);