There was an error while loading. Please reload this page.
1 parent a5974ce commit bd7697bCopy full SHA for bd7697b
1 file changed
plotly/matplotlylib/tests/test_renderer.py
@@ -199,3 +199,19 @@ def test_filled_path_collection_date_xaxis():
199
filled = [t for t in plotly_fig.data if t.fill == "toself"]
200
assert len(filled) >= 1
201
assert all(isinstance(x, str) for x in filled[0].x)
202
+
203
204
+def test_lines_markers_legend_plot():
205
+ x = [0, 1]
206
+ y = [0, 1]
207
+ label = "label"
208
+ plt.figure()
209
+ plt.plot(x, y, "o-", label=label)
210
+ plt.legend()
211
212
+ plotly_fig = tls.mpl_to_plotly(plt.gcf())
213
214
+ assert plotly_fig.data[0].mode == "lines+markers"
215
+ assert plotly_fig.data[0].x == tuple(x)
216
+ assert plotly_fig.data[0].y == tuple(y)
217
+ assert plotly_fig.data[0].name == "label"
0 commit comments