From 2fd670f88e3080bed057ce9133f8ea17bcf81be6 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 15 Dec 2021 01:21:14 +0100 Subject: [PATCH] Clarify current behavior of draw_path_collection. Note that the definition of "corresponding entry" is intentionally left a bit vague, because the current behavior is in fact not consistent between backends and will need to be harmonized first. The goal of this change here is mostly to describe the order in which `master_transform`, `all_transforms`, and `offsetTrans` are applied. --- lib/matplotlib/backend_bases.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 590790203cb1..672d90a07c1c 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -223,12 +223,15 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms, linewidths, linestyles, antialiaseds, urls, offset_position): """ - Draw a collection of paths selecting drawing properties from - the lists *facecolors*, *edgecolors*, *linewidths*, - *linestyles* and *antialiaseds*. *offsets* is a list of - offsets to apply to each of the paths. The offsets in - *offsets* are first transformed by *offsetTrans* before being - applied. + Draw a collection of *paths*. + + Each path is first transformed by the corresponding entry + in *all_transforms* (a list of (3, 3) matrices) and then by + *master_transform*. They are then translated by the corresponding + entry in *offsets*, which has been first transformed by *offsetTrans*. + + *facecolors*, *edgecolors*, *linewidths*, *linestyles*, and + *antialiased* are lists that set the corresponding properties. *offset_position* is unused now, but the argument is kept for backwards compatibility.