Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90e97af

Browse files
committed
Fix typo in set_adjustable check.
The intent of the getattr was to handle cases where ax.get_data_ratio has been patched to something that's not a method and therefore has no `__func__`.
1 parent 0851204 commit 90e97af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ def set_adjustable(self, adjustable, share=False):
13221322
else:
13231323
axs = [self]
13241324
if (adjustable == "datalim"
1325-
and any(getattr(ax.get_data_ratio, "__func__")
1325+
and any(getattr(ax.get_data_ratio, "__func__", None)
13261326
!= _AxesBase.get_data_ratio
13271327
for ax in axs)):
13281328
# Limits adjustment by apply_aspect assumes that the axes' aspect

0 commit comments

Comments
 (0)