Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions plotly/matplotlylib/tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"