44Legend guide
55************
66
7- Do not proceed unless you already have read :func: `~matplotlib.pyplot.legend ` and
8- :class: `matplotlib.legend.Legend `!
7+ Do not proceed unless you already have read :func: `~matplotlib.pyplot.legend `
8+ and :class: `matplotlib.legend.Legend `!
99
1010
1111What to be displayed
@@ -30,7 +30,7 @@ returns a tuple of two lists, i.e., list of artists and list of labels
3030(python string). However, it does not return all of its child
3131artists. It returns artists that are currently supported by matplotlib.
3232
33- For matplotlib v1.0 and before , the supported artists are as follows.
33+ For matplotlib v1.0 and earlier , the supported artists are as follows.
3434
3535 * :class: `~matplotlib.lines.Line2D `
3636 * :class: `~matplotlib.patches.Patch `
@@ -186,11 +186,12 @@ legend.
186186.. plot :: users/plotting/examples/simple_legend02.py
187187 :include-source:
188188
189+ .. _legend-complex-plots :
189190
190191Legend of Complex Plots
191192=======================
192193
193- In matplotlib v1.1 (FIXME when released) and later, the legend is
194+ In matplotlib v1.1 and later, the legend is
194195improved to support more plot commands and ease the customization.
195196
196197Artist Container
@@ -224,15 +225,15 @@ or ::
224225 legend([b1], ["Bar 1"])
225226
226227
227- At this time of writing, however, "bar" and "errorbar " are only
228+ At this time of writing, however, only "bar", "errorbar", and "stem " are
228229supported (hopefully the list will increase). Here is an example.
229230
230231.. plot :: mpl_examples/pylab_examples/legend_demo4.py
231232
232233Legend Handler
233234--------------
234235
235- One of the change is that drawing of legend handles is delegated to
236+ One of the changes is that drawing of legend handles has been delegated to
236237legend handlers. For example, :class: `~matplotlib.lines.Line2D `
237238instances are handled by
238239:class: `~matplotlib.legend_handler.HandlerLine2D `. The mapping
@@ -247,8 +248,9 @@ Let's consider the following sample code, ::
247248
248249For each *p_i *, matplotlib
249250
250- 1. check if *p_i * itself is in the handler_map
251- 2. if not, iterate over type(p_i).mro() until a matching key is found in the handler_map
251+ 1. check if *p_i * is in the handler_map
252+ 2. if not, iterate over type(p_i).mro() until a matching key is found
253+ in the handler_map
252254
253255
254256Unless specified, the defaul handler_map is used. Below is a partial
@@ -260,7 +262,7 @@ list of key-handler pairs included in the default handler map.
260262 * ...
261263
262264
263- The legend command takes an optional argument of "handler_map". When
265+ The legend() command takes an optional argument of "handler_map". When
264266provided, the default handler map will be updated (using dict.update
265267method) with the provided one. ::
266268
@@ -279,9 +281,9 @@ instances (p1 and p2). ::
279281In the above example, only *p1 * will be handled by *my_handler *, while
280282others will be handled by default handlers.
281283
282- The curent default handler_map has handlers for errobar and bar
284+ The curent default handler_map has handlers for errorbar and bar
283285plots. Also, it includes an entry for `tuple ` which is mapped to
284- `HandlerTuple `. It simply overplots all the handles for items in the
286+ `HandlerTuple `. It simply plots over all the handles for items in the
285287given tuple. For example,
286288
287289
@@ -312,5 +314,5 @@ pixles, and *handlebox* is a OffsetBox instance. Within the call, you
312314create relevant artists (using relevant properties from the *legend *
313315and/or *orig_handle *) and add them into the handlebox. The artists
314316needs to be scaled according to the fontsize (note that the size is in
315- pixel, i.e., this is dpi-scaled value). See legend_handler.py for more
316- details.
317+ pixel, i.e., this is dpi-scaled value). See :mod: ` ~matplotlib.legend_handler `
318+ for more details.
0 commit comments