Skip to content

Commit b719562

Browse files
Add lines+markers legend test
1 parent c0740bf commit b719562

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

plotly/matplotlylib/tests/test_renderer.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,20 @@ def test_multiple_traces_native_legend():
8484
assert plotly_fig.data[0].mode == "lines"
8585
assert plotly_fig.data[1].mode == "markers"
8686
assert plotly_fig.data[2].mode == "lines+markers"
87+
88+
89+
90+
def test_lines_markers_legend_plot():
91+
x = [0, 1]
92+
y = [0, 1]
93+
label = "label"
94+
plt.figure()
95+
plt.plot(x, y, "o-", label=label)
96+
plt.legend()
97+
98+
plotly_fig = tls.mpl_to_plotly(plt.gcf())
99+
100+
assert plotly_fig.data[0].mode == "lines+markers"
101+
assert plotly_fig.data[0].x == tuple(x)
102+
assert plotly_fig.data[0].y == tuple(y)
103+
assert plotly_fig.data[0].name == "label"

0 commit comments

Comments
 (0)