Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faceting support for all figure factory methods #3132

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Updated

- All `plotly.express` figure factory functions now support faceting [2646](https://github.com/plotly/plotly.py/issues/2646)


## [4.14.3] - 2021-01-12

Expand Down
2 changes: 1 addition & 1 deletion doc/python/plotly-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The Plotly Express API in general offers the following features:
* **Automatic Hover Labels**: PX functions populate the hover-label using the labels mentioned above, and provide [extra control with the `hover_name` and `hover_data` arguments](/python/hover-text-and-formatting/).
* **Styling Control**: PX functions [read styling information from the default figure template](/python/styling-plotly-express/), and support commonly-needed [cosmetic controls like `category_orders` and `color_discrete_map`](/python/styling-plotly-express/) to precisely control categorical variables.
* **Uniform Color Handling**: PX functions automatically switch between [continuous](/python/colorscales/) and [categorical color](/python/discrete-color/) based on the input type.
* **Faceting**: the 2D-cartesian plotting functions support [row, column and wrapped facetting with `facet_row`, `facet_col` and `facet_col_wrap` arguments](/python/facet-plots/).
* **Faceting**: Plotting functions support [row, column and wrapped facetting with `facet_row`, `facet_col` and `facet_col_wrap` arguments](/python/facet-plots/).
* **Marginal Plots**: the 2D-cartesian plotting functions support [marginal distribution plots](/python/marginal-plots/) with the `marginal`, `marginal_x` and `marginal_y` arguments.
* **A Pandas backend**: the 2D-cartesian plotting functions are available as [a Pandas plotting backend](/python/pandas-backend/) so you can call them via `df.plot()`.
* **Trendlines**: `px.scatter` supports [built-in trendlines with accessible model output](/python/linear-fits/).
Expand Down
90 changes: 90 additions & 0 deletions packages/python/plotly/plotly/express/_chart_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ def scatter_3d(
y=None,
z=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
symbol=None,
size=None,
text=None,
Expand Down Expand Up @@ -683,6 +688,11 @@ def line_3d(
y=None,
z=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
line_dash=None,
text=None,
line_group=None,
Expand Down Expand Up @@ -730,6 +740,11 @@ def scatter_ternary(
b=None,
c=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
symbol=None,
size=None,
text=None,
Expand Down Expand Up @@ -770,6 +785,11 @@ def line_ternary(
b=None,
c=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
line_dash=None,
line_group=None,
hover_name=None,
Expand Down Expand Up @@ -805,6 +825,11 @@ def scatter_polar(
r=None,
theta=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
symbol=None,
size=None,
hover_name=None,
Expand Down Expand Up @@ -850,6 +875,11 @@ def line_polar(
r=None,
theta=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
line_dash=None,
hover_name=None,
hover_data=None,
Expand Down Expand Up @@ -892,6 +922,11 @@ def bar_polar(
r=None,
theta=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand Down Expand Up @@ -1095,6 +1130,11 @@ def scatter_mapbox(
lat=None,
lon=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
text=None,
hover_name=None,
hover_data=None,
Expand Down Expand Up @@ -1135,6 +1175,11 @@ def choropleth_mapbox(
featureidkey=None,
locations=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand Down Expand Up @@ -1171,6 +1216,11 @@ def density_mapbox(
lat=None,
lon=None,
z=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
Expand Down Expand Up @@ -1208,6 +1258,11 @@ def line_mapbox(
lat=None,
lon=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
text=None,
hover_name=None,
hover_data=None,
Expand Down Expand Up @@ -1241,6 +1296,11 @@ def scatter_matrix(
data_frame=None,
dimensions=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
symbol=None,
size=None,
hover_name=None,
Expand Down Expand Up @@ -1280,6 +1340,11 @@ def parallel_coordinates(
data_frame=None,
dimensions=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
labels=None,
color_continuous_scale=None,
range_color=None,
Expand All @@ -1304,6 +1369,11 @@ def parallel_categories(
data_frame=None,
dimensions=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
labels=None,
color_continuous_scale=None,
range_color=None,
Expand Down Expand Up @@ -1331,6 +1401,11 @@ def pie(
names=None,
values=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
color_discrete_sequence=None,
color_discrete_map=None,
hover_name=None,
Expand Down Expand Up @@ -1380,6 +1455,11 @@ def sunburst(
path=None,
ids=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
color_continuous_scale=None,
range_color=None,
color_continuous_midpoint=None,
Expand Down Expand Up @@ -1430,6 +1510,11 @@ def treemap(
ids=None,
path=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
color_continuous_scale=None,
range_color=None,
color_continuous_midpoint=None,
Expand Down Expand Up @@ -1518,6 +1603,11 @@ def funnel_area(
names=None,
values=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
color_discrete_sequence=None,
color_discrete_map=None,
hover_name=None,
Expand Down