Skip to content

Commit 817bc3a

Browse files
changelog and docs
1 parent a1f0232 commit 817bc3a

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1111
## [4.13.0] - UNRELEASED
1212

1313
### Added
14-
14+
- `px.choropleth`, `px.scatter_geo` and `px.line_geo` now support faceting [2923](https://github.com/plotly/plotly.py/pull/2923)
15+
- `px.scatter_geo` and `px.line_geo` now support `geojson`/`featureidkey` input [2923](https://github.com/plotly/plotly.py/pull/2923)
16+
- `px.scatter_geo` now supports `symbol` [2923](https://github.com/plotly/plotly.py/pull/2923)
1517
- `go.Figure` now has a `set_subplots` method to set subplots on an already
1618
existing figure. [2866](https://github.com/plotly/plotly.py/pull/2866)
1719
- Added `Turbo` colorscale and fancier swatch display functions
@@ -37,6 +39,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3739

3840
### Fixed
3941

42+
- `px.scatter_geo` support for `text` is fixed [2923](https://github.com/plotly/plotly.py/pull/2923)
4043
- the `x` and `y` parameters of `px.imshow` are now used also in the case where
4144
an Image trace is used (for RGB data or with `binary_string=True`). However,
4245
only numerical values are accepted (while the Heatmap trace allows date or

doc/python/facet-plots.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ fig = px.histogram(df, x="total_bill", y="tip", color="sex", facet_row="time", f
8383
fig.show()
8484
```
8585

86+
### Choropleth Column Facets
87+
88+
*new in version 4.13*
89+
90+
```python
91+
import plotly.express as px
92+
93+
df = px.data.election()
94+
df = df.melt(id_vars="district", value_vars=["Coderre", "Bergeron", "Joly"],
95+
var_name="candidate", value_name="votes")
96+
geojson = px.data.election_geojson()
97+
98+
fig = px.choropleth(df, geojson=geojson, color="votes", facet_col="candidate",
99+
locations="district", featureidkey="properties.district"
100+
)
101+
fig.update_geos(fitbounds="locations", visible=False, projection_type="mercator")
102+
fig.show()
103+
```
104+
86105
### Adding Lines and Rectangles to Facet Plots
87106

88107
*introduced in plotly 4.12*
@@ -133,7 +152,8 @@ trace.update(legendgroup="trendline", showlegend=False)
133152
fig.add_trace(trace, row="all", col="all", exclude_empty_subplots=True)
134153

135154
# set only the last trace added to appear in the legend
136-
fig.data[-1].update(showlegend=True)
155+
# `selector=-1` introduced in plotly v4.13
156+
fig.update_traces(selector=-1, showlegend=True)
137157
fig.show()
138158
```
139159

0 commit comments

Comments
 (0)