Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3539f18

Browse files
committed
Small additional doc updates.
1 parent 512e403 commit 3539f18

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

doc/api/next_api_changes/2018-06-01-AFV.rst renamed to doc/api/next_api_changes/behavior/20699-AFV.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ after instantiating a legend.
1919
leg.legendHandles[0].set_mec("black") # marker edge color
2020
2121
The former legend handler for Line2D objects has been renamed
22-
`.HandlerLine2DCompound`. To revert to the behavior that was used before
23-
Matplotlib 3, one can use
22+
`.HandlerLine2DCompound`. To revert to the previous behavior, one can use
2423

2524
.. code::
2625

lib/matplotlib/legend_handler.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ def get_ydata(self, legend, xdescent, ydescent, width, height, fontsize):
207207
class HandlerLine2DCompound(HandlerNpoints):
208208
"""
209209
Original handler for `.Line2D` instances, that relies on combining
210-
a line-only with a marker-only artist.
210+
a line-only with a marker-only artist. May be deprecated in the future.
211211
"""
212+
212213
def __init__(self, marker_pad=0.3, numpoints=None, **kwargs):
213214
"""
214215
Parameters
@@ -257,25 +258,22 @@ class HandlerLine2D(HandlerNpoints):
257258
"""
258259
Handler for `.Line2D` instances.
259260
260-
A class similar to the original handler for `.Line2D` instances but
261-
that uses a monolithic artist rather than using one artist for the
262-
line and another one for the marker(s). NB: the former handler, in
263-
use before Matplotlib 3, is still available as `.HandlerLine2DCompound`.
264-
261+
See Also
262+
--------
263+
HandlerLine2DCompound : An earlier handler implementation, which used one
264+
artist for the line and another for the marker(s).
265265
"""
266+
266267
def __init__(self, marker_pad=0.3, numpoints=None, **kw):
267268
"""
268269
Parameters
269270
----------
270271
marker_pad : float
271272
Padding between points in legend entry.
272-
273273
numpoints : int
274274
Number of points to show in legend entry.
275-
276-
Notes
277-
-----
278-
Any other keyword arguments are given to `HandlerNpoints`.
275+
**kwargs
276+
Keyword arguments forwarded to `.HandlerNpoints`.
279277
"""
280278
HandlerNpoints.__init__(self, marker_pad=marker_pad,
281279
numpoints=numpoints, **kw)

lib/matplotlib/tests/test_legend.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,7 @@ def test_legend_text_axes():
865865

866866

867867
def test_handlerline2d():
868-
'''Test consistency of the marker for the (monolithic) Line2D legend
869-
handler (see #11357).
870-
'''
868+
# Test marker consistency for monolithic Line2D legend handler (#11357).
871869
fig, ax = plt.subplots()
872870
ax.scatter([0, 1], [0, 1], marker="v")
873871
handles = [mlines.Line2D([0], [0], marker="v")]

0 commit comments

Comments
 (0)