-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2614 from plotly/nocolor
px.NO_COLOR
- Loading branch information
Showing
11 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/python/plotly/plotly/tests/test_core/test_px/test_colors.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import plotly.express as px | ||
import numpy as np | ||
|
||
|
||
def test_reversed_colorscale(): | ||
|
43 changes: 43 additions & 0 deletions
43
packages/python/plotly/plotly/tests/test_core/test_px/test_facets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import plotly.express as px | ||
from pytest import approx | ||
|
||
|
||
def test_facets(): | ||
df = px.data.tips() | ||
fig = px.scatter(df, x="total_bill", y="tip") | ||
assert "xaxis2" not in fig.layout | ||
assert "yaxis2" not in fig.layout | ||
assert fig.layout.xaxis.domain == (0.0, 1.0) | ||
assert fig.layout.yaxis.domain == (0.0, 1.0) | ||
|
||
fig = px.scatter(df, x="total_bill", y="tip", facet_row="sex", facet_col="smoker") | ||
assert fig.layout.xaxis4.domain[0] - fig.layout.xaxis.domain[1] == approx(0.02) | ||
assert fig.layout.yaxis4.domain[0] - fig.layout.yaxis.domain[1] == approx(0.03) | ||
|
||
fig = px.scatter(df, x="total_bill", y="tip", facet_col="day", facet_col_wrap=2) | ||
assert fig.layout.xaxis4.domain[0] - fig.layout.xaxis.domain[1] == approx(0.02) | ||
assert fig.layout.yaxis4.domain[0] - fig.layout.yaxis.domain[1] == approx(0.07) | ||
|
||
fig = px.scatter( | ||
df, | ||
x="total_bill", | ||
y="tip", | ||
facet_row="sex", | ||
facet_col="smoker", | ||
facet_col_spacing=0.09, | ||
facet_row_spacing=0.08, | ||
) | ||
assert fig.layout.xaxis4.domain[0] - fig.layout.xaxis.domain[1] == approx(0.09) | ||
assert fig.layout.yaxis4.domain[0] - fig.layout.yaxis.domain[1] == approx(0.08) | ||
|
||
fig = px.scatter( | ||
df, | ||
x="total_bill", | ||
y="tip", | ||
facet_col="day", | ||
facet_col_wrap=2, | ||
facet_col_spacing=0.09, | ||
facet_row_spacing=0.08, | ||
) | ||
assert fig.layout.xaxis4.domain[0] - fig.layout.xaxis.domain[1] == approx(0.09) | ||
assert fig.layout.yaxis4.domain[0] - fig.layout.yaxis.domain[1] == approx(0.08) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters