8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8eca0ed commit 9bc95e4Copy full SHA for 9bc95e4
galleries/users_explain/axes/legend_guide.py
@@ -73,15 +73,14 @@
73
74
If the handles are not directly accessible, for example when using some
75
`Third-party packages <https://matplotlib.org/mpl-third-party/>`_, they can be accessed
76
-as follows::
+via `.Axes.get_legend_handles_and_labels` and fed into `.Axes.legend` explicitly.
77
+Here we use a dictionary to rename existing labels::
78
79
my_map = {'Line Up':'Up', 'Line Down':'Down'}
80
81
handles, labels = ax.get_legend_handles_labels()
82
ax.legend(handles, [my_map[l] for l in labels])
83
-Here we use a dictionary to ensure that we rename the correct entry.
84
-
85
86
.. _proxy_legend_handles:
87
0 commit comments