Skip to content

Commit a7d0677

Browse files
authored
Merge pull request #27846 from dstansby/leg-elem-doc
Make example in legend_elements doc more generalisable
2 parents d57fa97 + 034a540 commit a7d0677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/collections.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1038,12 +1038,12 @@ def legend_elements(self, prop="colors", num="auto",
10381038
Create legend handles and labels for a PathCollection.
10391039
10401040
Each legend handle is a `.Line2D` representing the Path that was drawn,
1041-
and each label is a string what each Path represents.
1041+
and each label is a string that represents the Path.
10421042
10431043
This is useful for obtaining a legend for a `~.Axes.scatter` plot;
10441044
e.g.::
10451045
1046-
scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3])
1046+
scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3], num=None)
10471047
plt.legend(*scatter.legend_elements())
10481048
10491049
creates three legend elements, one for each color with the numerical

0 commit comments

Comments
 (0)