Skip to content

Commit

Permalink
Merge pull request #4372 from NeilGirdhar/master
Browse files Browse the repository at this point in the history
Remove use of matplotlib's get_offset_position
  • Loading branch information
alexcjohnson authored Oct 4, 2023
2 parents 294d743 + c0af1cc commit e19dec8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [UNRELEASED]

### Fixed
- Repair crash on Matplotlib 3.8 related to get_offset_position [[#4372](https://github.com/plotly/plotly.py/pull/4372)],

## [5.17.0] - 2023-09-15

### Updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def process_transform(

code = "display"
if ax is not None:
for (c, trans) in [
for c, trans in [
("data", ax.transData),
("axes", ax.transAxes),
("figure", ax.figure.transFigure),
Expand Down Expand Up @@ -130,7 +130,7 @@ def crawl_ax(self, ax):
self.draw_line(ax, line)
for text in ax.texts:
self.draw_text(ax, text)
for (text, ttp) in zip(
for text, ttp in zip(
[ax.xaxis.label, ax.yaxis.label, ax.title],
["xlabel", "ylabel", "title"],
):
Expand Down Expand Up @@ -285,8 +285,14 @@ def draw_collection(
"zorder": collection.get_zorder(),
}

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

self.renderer.draw_path_collection(
paths=processed_paths,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pandas==0.24.2
numpy==1.19.5
xarray==0.10.9
statsmodels==0.10.2
pillow==5.2.0
pillow==6.2.0
pytest==3.5.1
pytz==2016.10
ipython[all]==5.4.0
Expand All @@ -15,7 +15,7 @@ scipy==1.2.3
shapely==1.7.0
geopandas==0.3.0
pyshp==1.2.10
matplotlib==2.2.3
matplotlib==3.5.3
scikit-image==0.14.4
psutil==5.7.0
kaleido
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ scipy==1.6.2
Shapely==1.7.1
geopandas==0.9.0
pyshp==2.1.3
matplotlib==2.2.3
matplotlib==3.7.3
scikit-image==0.18.1
psutil==5.7.0
kaleido
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requests==2.25.1
tenacity==6.2.0
pandas==1.2.4
numpy==1.20.2
numpy==1.21.6
xarray==0.17.0
statsmodels
Pillow==8.2.0
Expand All @@ -15,7 +15,7 @@ scipy==1.6.2
Shapely==1.7.1
geopandas==0.9.0
pyshp==2.1.3
matplotlib==2.2.3
matplotlib==3.8.0
scikit-image==0.18.1
psutil==5.7.0
kaleido
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requests==2.25.1
tenacity==6.2.0
pandas==2.0.2
numpy==1.20.3
numpy==1.21.6
xarray==0.17.0
statsmodels
Pillow==8.2.0
Expand All @@ -15,7 +15,7 @@ scipy==1.6.2
Shapely==1.7.1
geopandas==0.9.0
pyshp==2.1.3
matplotlib==2.2.3
matplotlib==3.8.0
scikit-image==0.18.1
psutil==5.7.0
kaleido
Expand Down

0 comments on commit e19dec8

Please sign in to comment.