Skip to content

Commit 465a7d2

Browse files
committed
Fix matplotlib missing get_offset_position crash
* Update matplotlib test versions
1 parent 294d743 commit 465a7d2

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [UNRELEASED]
6+
7+
### Fixed
8+
- Repair crash on Matplotlib 3.8 related to get_offset_position [[#4372](https://github.com/plotly/plotly.py/pull/4372)],
9+
510
## [5.17.0] - 2023-09-15
611

712
### Updated

Diff for: packages/python/plotly/plotly/matplotlylib/mplexporter/exporter.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,12 @@ def draw_collection(
285285
"zorder": collection.get_zorder(),
286286
}
287287

288+
# TODO: When matplotlib's minimum version is bumped to 3.8, this can be
289+
# simplified since collection.get_offset_position no longer exists.
288290
offset_dict = {"data": "before", "screen": "after"}
289-
offset_order = offset_dict[collection.get_offset_position()]
291+
offset_order = (offset_dict[collection.get_offset_position()]
292+
if hasattr(collection, "get_offset_position")
293+
else "after")
290294

291295
self.renderer.draw_path_collection(
292296
paths=processed_paths,

Diff for: packages/python/plotly/test_requirements/requirements_37_optional.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scipy==1.2.3
1515
shapely==1.7.0
1616
geopandas==0.3.0
1717
pyshp==1.2.10
18-
matplotlib==2.2.3
18+
matplotlib==3.5.3
1919
scikit-image==0.14.4
2020
psutil==5.7.0
2121
kaleido

Diff for: packages/python/plotly/test_requirements/requirements_38_optional.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scipy==1.6.2
1515
Shapely==1.7.1
1616
geopandas==0.9.0
1717
pyshp==2.1.3
18-
matplotlib==2.2.3
18+
matplotlib==3.7.3
1919
scikit-image==0.18.1
2020
psutil==5.7.0
2121
kaleido

Diff for: packages/python/plotly/test_requirements/requirements_39_optional.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scipy==1.6.2
1515
Shapely==1.7.1
1616
geopandas==0.9.0
1717
pyshp==2.1.3
18-
matplotlib==2.2.3
18+
matplotlib==3.8.0
1919
scikit-image==0.18.1
2020
psutil==5.7.0
2121
kaleido

Diff for: packages/python/plotly/test_requirements/requirements_39_pandas_2_optional.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scipy==1.6.2
1515
Shapely==1.7.1
1616
geopandas==0.9.0
1717
pyshp==2.1.3
18-
matplotlib==2.2.3
18+
matplotlib==3.8.0
1919
scikit-image==0.18.1
2020
psutil==5.7.0
2121
kaleido

0 commit comments

Comments
 (0)