diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index bee74ed0a006..ab1c2bf1a6ef 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -258,7 +258,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms, def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, - antialiased, edgecolors, *, hatchcolors=None): + antialiased, edgecolors): """ Draw a quadmesh. @@ -271,14 +271,11 @@ def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight, if edgecolors is None: edgecolors = facecolors - if hatchcolors is None: - hatchcolors = [] linewidths = np.array([gc.get_linewidth()], float) return self.draw_path_collection( gc, master_transform, paths, [], offsets, offsetTrans, facecolors, - edgecolors, linewidths, [], [antialiased], [None], 'screen', - hatchcolors=hatchcolors) + edgecolors, linewidths, [], [antialiased], [None], 'screen') def draw_gouraud_triangles(self, gc, triangles_array, colors_array, transform): diff --git a/lib/matplotlib/backend_bases.pyi b/lib/matplotlib/backend_bases.pyi index fc25ab416a74..90e1a6979f61 100644 --- a/lib/matplotlib/backend_bases.pyi +++ b/lib/matplotlib/backend_bases.pyi @@ -78,8 +78,6 @@ class RendererBase: facecolors: Sequence[ColorType], antialiased: bool, edgecolors: Sequence[ColorType] | ColorType | None, - *, - hatchcolors: Sequence[ColorType] | ColorType | None = None, ) -> None: ... def draw_gouraud_triangles( self, diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index ab1bd337d805..ec6d40805da0 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -2547,8 +2547,7 @@ def draw(self, renderer): coordinates, offsets, offset_trf, # Backends expect flattened rgba arrays (n*m, 4) for fc and ec self.get_facecolor().reshape((-1, 4)), - self._antialiased, self.get_edgecolors().reshape((-1, 4)), - hatchcolors=self.get_hatchcolor().reshape((-1, 4))) + self._antialiased, self.get_edgecolors().reshape((-1, 4))) gc.restore() renderer.close_group(self.__class__.__name__) self.stale = False diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 0e33d38dfd93..6ecbcba1df18 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -190,8 +190,7 @@ class RendererAgg agg::trans_affine &offset_trans, ColorArray &facecolors, bool antialiased, - ColorArray &edgecolors, - ColorArray &hatchcolors); + ColorArray &edgecolors); template void draw_gouraud_triangles(GCAgg &gc, @@ -1163,8 +1162,7 @@ inline void RendererAgg::draw_quad_mesh(GCAgg &gc, agg::trans_affine &offset_trans, ColorArray &facecolors, bool antialiased, - ColorArray &edgecolors, - ColorArray &hatchcolors) + ColorArray &edgecolors) { QuadMeshGenerator path_generator(mesh_width, mesh_height, coordinates); @@ -1172,6 +1170,7 @@ inline void RendererAgg::draw_quad_mesh(GCAgg &gc, array::scalar linewidths(gc.linewidth); array::scalar antialiaseds(antialiased); DashesVector linestyles; + ColorArray hatchcolors = py::array_t().reshape({0, 4}).unchecked(); _draw_path_collection_generic(gc, master_transform, diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp index 053606697388..3dd50b31f64a 100644 --- a/src/_backend_agg_wrapper.cpp +++ b/src/_backend_agg_wrapper.cpp @@ -182,14 +182,12 @@ PyRendererAgg_draw_quad_mesh(RendererAgg *self, agg::trans_affine offset_trans, py::array_t facecolors_obj, bool antialiased, - py::array_t edgecolors_obj, - py::array_t hatchcolors_obj) + py::array_t edgecolors_obj) { auto coordinates = coordinates_obj.mutable_unchecked<3>(); auto offsets = convert_points(offsets_obj); auto facecolors = convert_colors(facecolors_obj); auto edgecolors = convert_colors(edgecolors_obj); - auto hatchcolors = convert_colors(hatchcolors_obj); self->draw_quad_mesh(gc, master_transform, @@ -200,8 +198,7 @@ PyRendererAgg_draw_quad_mesh(RendererAgg *self, offset_trans, facecolors, antialiased, - edgecolors, - hatchcolors); + edgecolors); } static void @@ -240,8 +237,7 @@ PYBIND11_MODULE(_backend_agg, m, py::mod_gil_not_used()) .def("draw_quad_mesh", &PyRendererAgg_draw_quad_mesh, "gc"_a, "master_transform"_a, "mesh_width"_a, "mesh_height"_a, "coordinates"_a, "offsets"_a, "offset_trans"_a, "facecolors"_a, - "antialiased"_a, "edgecolors"_a, py::kw_only(), - "hatchcolors"_a = py::array_t().reshape({0, 4})) + "antialiased"_a, "edgecolors"_a) .def("draw_gouraud_triangles", &PyRendererAgg_draw_gouraud_triangles, "gc"_a, "points"_a, "colors"_a, "trans"_a = nullptr)