From daf7c408c2b1e42b26a87e05a1bbccc3959f6f8b Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 31 Dec 2016 23:49:06 +0100 Subject: [PATCH] Merged 158f36e --- lib/matplotlib/legend_handler.py | 2 +- lib/matplotlib/tests/test_axes.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/legend_handler.py b/lib/matplotlib/legend_handler.py index 2d5f4aa78d89..fccf31d4b414 100644 --- a/lib/matplotlib/legend_handler.py +++ b/lib/matplotlib/legend_handler.py @@ -265,7 +265,7 @@ def get_numpoints(self, legend): return self._numpoints def _default_update_prop(self, legend_handle, orig_handle): - lw = orig_handle.get_linewidth()[0] + lw = orig_handle.get_linewidths()[0] dashes = orig_handle.get_dashes()[0] color = orig_handle.get_colors()[0] legend_handle.set_color(color) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 8203c0ad3a03..bda8822a78da 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -4820,6 +4820,12 @@ def test_scatter_color_masking(): assert linewidths[1] == 3 +@cleanup +def test_eventplot_legend(): + plt.eventplot([1.0], label='Label') + plt.legend() + + if __name__ == '__main__': import nose import sys