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

Skip to content

Commit fd2b4b5

Browse files
committed
Use _axis_map instead of getattr
1 parent 651a874 commit fd2b4b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,7 +3670,7 @@ def apply_mask(arrays, mask):
36703670
continue
36713671
hlmarker = (
36723672
himarker
3673-
if getattr(self, f"{dep_axis}axis").get_inverted() ^ idx
3673+
if self._axis_map[dep_axis].get_inverted() ^ idx
36743674
else lomarker)
36753675
x_masked, y_masked, hl_masked = apply_mask(
36763676
[x, y, hl], lims & everymask)
@@ -4275,7 +4275,7 @@ def do_patch(xs, ys, **kwargs):
42754275
if manage_ticks:
42764276
axis_name = "x" if vert else "y"
42774277
interval = getattr(self.dataLim, f"interval{axis_name}")
4278-
axis = getattr(self, f"{axis_name}axis")
4278+
axis = self._axis_map[axis_name]
42794279
positions = axis.convert_units(positions)
42804280
# The 0.5 additional padding ensures reasonable-looking boxes
42814281
# even when drawing a single box. We set the sticky edge to

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def _break_share_link(ax, grouper):
922922
for name in ax._axis_names:
923923
last_ax = _break_share_link(ax, ax._shared_axes[name])
924924
if last_ax is not None:
925-
_reset_locators_and_formatters(getattr(last_ax, f"{name}axis"))
925+
_reset_locators_and_formatters(last_ax._axis_map[name])
926926

927927
# Break link between any twinned axes
928928
_break_share_link(ax, ax._twinned_axes)

0 commit comments

Comments
 (0)