diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 7c9185458303..cad1b3ef3ca9 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2601,9 +2601,9 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True): for ax in self._shared_y_axes.get_siblings(self) if hasattr(ax, "lines") for artist in ax.get_children()])) - if self.get_xscale().lower() == 'log': + if self.get_xscale() == 'log': x_stickies = x_stickies[x_stickies > 0] - if self.get_yscale().lower() == 'log': + if self.get_yscale() == 'log': y_stickies = y_stickies[y_stickies > 0] def handle_single_axis(scale, autoscaleon, shared_axes, interval, diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 1cf574756955..15fa8cd5b863 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -98,11 +98,10 @@ def __init__(self, axes, loc, label=None, self.set_figure(axes.figure) self.axes = axes - name = self.__name__.lower() - self._loc = loc self._major = major + name = self.__name__ major_minor = "major" if major else "minor" if size is None: @@ -448,7 +447,7 @@ def _get_text2_transform(self): def apply_tickdir(self, tickdir): """Set tick direction. Valid values are 'in', 'out', 'inout'.""" if tickdir is None: - tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()] + tickdir = mpl.rcParams[f'{self.__name__}.direction'] _api.check_in_list(['in', 'out', 'inout'], tickdir=tickdir) self._tickdir = tickdir @@ -520,7 +519,7 @@ def _get_text2_transform(self): def apply_tickdir(self, tickdir): if tickdir is None: - tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()] + tickdir = mpl.rcParams[f'{self.__name__}.direction'] self._tickdir = tickdir if self._tickdir == 'in': diff --git a/lib/matplotlib/blocking_input.py b/lib/matplotlib/blocking_input.py index 561fb4520136..fde7f30c5f38 100644 --- a/lib/matplotlib/blocking_input.py +++ b/lib/matplotlib/blocking_input.py @@ -149,10 +149,9 @@ def key_event(self): if event.key is None: # At least in OSX gtk backend some keys return None. return - key = event.key.lower() - if key in ['backspace', 'delete']: + if event.key in ['backspace', 'delete']: self.mouse_event_pop(event) - elif key in ['escape', 'enter']: + elif event.key in ['escape', 'enter']: self.mouse_event_stop(event) else: self.mouse_event_add(event)