Skip to content

Commit 0313262

Browse files
Add regression test for transparent line colors
1 parent 34488dd commit 0313262

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎plotly/matplotlylib/tests/test_renderer.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ def test_boxplot_converts_with_none_marker_facecolor():
9393
ax.boxplot(np.random.randn(100, 4))
9494
plotly_fig = tls.mpl_to_plotly(fig) # used to raise ValueError
9595
assert len(plotly_fig.data) > 0
96+
97+
98+
def test_line_with_none_color_converts():
99+
"""Lines with color='none' use the string 'none' for the line color,
100+
which plotly rejects; it must be exported as a transparent line."""
101+
fig, ax = plt.subplots()
102+
ax.plot([0, 1], [0, 1], color="none")
103+
plotly_fig = tls.mpl_to_plotly(fig) # used to raise ValueError
104+
assert len(plotly_fig.data) == 1
105+
assert plotly_fig.data[0].line.color == "rgba(0,0,0,0)"

0 commit comments

Comments
 (0)