Skip to content

Commit 3cd8144

Browse files
committed
Remove use of matplotlib's get_offset_position
1 parent 294d743 commit 3cd8144

File tree

1 file changed

+5
-1
lines changed
  • packages/python/plotly/plotly/matplotlylib/mplexporter

1 file changed

+5
-1
lines changed

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,

0 commit comments

Comments
 (0)