diff --git a/plotly/matplotlylib/tests/test_renderer.py b/plotly/matplotlylib/tests/test_renderer.py index 0d63e4815b..79252051af 100644 --- a/plotly/matplotlylib/tests/test_renderer.py +++ b/plotly/matplotlylib/tests/test_renderer.py @@ -84,3 +84,20 @@ def test_multiple_traces_native_legend(): assert plotly_fig.data[0].mode == "lines" assert plotly_fig.data[1].mode == "markers" assert plotly_fig.data[2].mode == "lines+markers" + + + +def test_lines_markers_legend_plot(): + x = [0, 1] + y = [0, 1] + label = "label" + plt.figure() + plt.plot(x, y, "o-", label=label) + plt.legend() + + plotly_fig = tls.mpl_to_plotly(plt.gcf()) + + assert plotly_fig.data[0].mode == "lines+markers" + assert plotly_fig.data[0].x == tuple(x) + assert plotly_fig.data[0].y == tuple(y) + assert plotly_fig.data[0].name == "label"