diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 81db24d0c026..81cd13567bc0 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -1038,12 +1038,12 @@ def legend_elements(self, prop="colors", num="auto", Create legend handles and labels for a PathCollection. Each legend handle is a `.Line2D` representing the Path that was drawn, - and each label is a string what each Path represents. + and each label is a string that represents the Path. This is useful for obtaining a legend for a `~.Axes.scatter` plot; e.g.:: - scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3]) + scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3], num=None) plt.legend(*scatter.legend_elements()) creates three legend elements, one for each color with the numerical
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: