Skip to content

Commit 2b03f57

Browse files
unmatched facet warning
1 parent d39828e commit 2b03f57

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

python/facet-plots.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.3
23+
version: 3.6.8
2424
plotly:
2525
description: How to make Facet and Trellis Plots in Python with Plotly.
2626
display_as: statistical
@@ -82,17 +82,24 @@ fig.show()
8282

8383
### Facets with independent axes
8484

85-
By default, facet axes are linked together: zooming inside one of the facets will also zoom in the other facets. You can disable this behaviour as follows.
85+
By default, facet axes are linked together: zooming inside one of the facets will also zoom in the other facets. You can disable this behaviour when you use `facet_row` only, by disabling `matches` on the Y axes, or when using `facet_col` only, by disabling `matches` on the X axes. It is not recommended to use this approach when using `facet_row` and `facet_col` together, as in this case it becomes very hard to understand the labelling of axes and grid lines.
8686

8787
```python
8888
import plotly.express as px
8989
df = px.data.tips()
90-
fig = px.scatter(df, x="total_bill", y="tip", color='sex',
91-
facet_row="day", facet_col='time')
92-
# No match between subplot axes
93-
fig.update_xaxes(matches=None)
90+
fig = px.scatter(df, x="total_bill", y="tip", color='sex', facet_row="day")
9491
fig.update_yaxes(matches=None)
95-
# Show ticks for each axis since they are now independent
96-
fig.update_xaxes(showticklabels=True)
9792
fig.show()
9893
```
94+
95+
```python
96+
import plotly.express as px
97+
df = px.data.tips()
98+
fig = px.scatter(df, x="total_bill", y="tip", color='sex', facet_col="day")
99+
fig.update_xaxes(matches=None)
100+
fig.show()
101+
```
102+
103+
```python
104+
105+
```

0 commit comments

Comments
 (0)