Skip to content

Commit ab15b75

Browse files
committed
Revert "Fix unit info setting axis label"
This reverts commit 31dee3a.
1 parent e4e158e commit ab15b75

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,9 +2545,7 @@ def _process_unit_info(self, datasets=None, kwargs=None, *, convert=True):
25452545
except KeyError:
25462546
raise ValueError(f"Invalid axis name: {axis_name!r}") from None
25472547
# Update from data if axis is already set but no unit is set yet.
2548-
if (axis is not None and
2549-
data is not None and not
2550-
axis.have_units_and_converter()):
2548+
if axis is not None and data is not None and not axis.have_units():
25512549
axis.update_units(data)
25522550
for axis_name, axis in axis_map.items():
25532551
# Return if no axis is set.

lib/matplotlib/axis.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,17 +1728,8 @@ def _update_axisinfo(self):
17281728
self.set_default_intervals()
17291729

17301730
def have_units(self):
1731-
"""
1732-
Return `True` if units or a converter have been set.
1733-
"""
17341731
return self.converter is not None or self.units is not None
17351732

1736-
def have_units_and_converter(self):
1737-
"""
1738-
Return `True` if units and a converter have been set.
1739-
"""
1740-
return self.converter is not None and self.units is not None
1741-
17421733
def convert_units(self, x):
17431734
# If x is natively supported by Matplotlib, doesn't need converting
17441735
if munits._is_natively_supported(x):

0 commit comments

Comments
 (0)