|
68 | 68 |
|
69 | 69 | Not all handles can be turned into legend entries automatically,
|
70 | 70 | so it is often necessary to create an artist which *can*. Legend handles
|
71 |
| -don't have to exists on the Figure or Axes in order to be used. |
| 71 | +don't have to exist on the Figure or Axes in order to be used. |
72 | 72 |
|
73 | 73 | Suppose we wanted to create a legend which has an entry for some data which
|
74 | 74 | is represented by a red color:
|
|
83 | 83 | plt.show()
|
84 | 84 |
|
85 | 85 | ###############################################################################
|
86 |
| -# There are many supported legend handles, instead of creating a patch of color |
| 86 | +# There are many supported legend handles. Instead of creating a patch of color |
87 | 87 | # we could have created a line with a marker:
|
88 | 88 |
|
89 | 89 | import matplotlib.lines as mlines
|
|
104 | 104 | # The ``bbox_to_anchor`` keyword gives a great degree of control for manual
|
105 | 105 | # legend placement. For example, if you want your axes legend located at the
|
106 | 106 | # figure's top right-hand corner instead of the axes' corner, simply specify
|
107 |
| -# the corner's location, and the coordinate system of that location:: |
| 107 | +# the corner's location and the coordinate system of that location:: |
108 | 108 | #
|
109 | 109 | # plt.legend(bbox_to_anchor=(1, 1),
|
110 | 110 | # bbox_transform=plt.gcf().transFigure)
|
|
137 | 137 | # the :func:`legend` function multiple times, you will find that only one
|
138 | 138 | # legend ever exists on the Axes. This has been done so that it is possible
|
139 | 139 | # to call :func:`legend` repeatedly to update the legend to the latest
|
140 |
| -# handles on the Axes, so to persist old legend instances, we must add them |
| 140 | +# handles on the Axes. To keep old legend instances, we must add them |
141 | 141 | # manually to the Axes:
|
142 | 142 |
|
143 | 143 | line1, = plt.plot([1, 2, 3], label="Line 1", linestyle='--')
|
|
0 commit comments