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
16 changes: 16 additions & 0 deletions plotly/matplotlylib/tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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()
Expand Down