diff --git a/plotly/matplotlylib/tests/test_renderer.py b/plotly/matplotlylib/tests/test_renderer.py index a355db7dc4..bc0f6a585f 100644 --- a/plotly/matplotlylib/tests/test_renderer.py +++ b/plotly/matplotlylib/tests/test_renderer.py @@ -25,6 +25,22 @@ def test_native_legend_enabled_when_matplotlib_legend_present(): assert plotly_fig.data[1].name == "Line 2" +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" + + def test_no_fake_legend_shapes_with_native_legend(): """Test that fake legend shapes are not created when using native legend.""" fig, ax = plt.subplots()