diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 7f10f0407bed..83ac2f82cc62 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -448,28 +448,16 @@ def _get_gridline(self): def update_position(self, loc): 'Set the location of tick in data coords with scalar *loc*' - x = loc - - nonlinear = (hasattr(self.axes, 'yaxis') and - self.axes.yaxis.get_scale() != 'linear' or - hasattr(self.axes, 'xaxis') and - self.axes.xaxis.get_scale() != 'linear') - if self.tick1On: - self.tick1line.set_xdata((x,)) + self.tick1line.set_xdata((loc,)) if self.tick2On: - self.tick2line.set_xdata((x,)) + self.tick2line.set_xdata((loc,)) if self.gridOn: - self.gridline.set_xdata((x,)) + self.gridline.set_xdata((loc,)) if self.label1On: - self.label1.set_x(x) + self.label1.set_x(loc) if self.label2On: - self.label2.set_x(x) - - if nonlinear: - self.tick1line._invalid = True - self.tick2line._invalid = True - self.gridline._invalid = True + self.label2.set_x(loc) self._loc = loc self.stale = True @@ -582,28 +570,17 @@ def _get_gridline(self): return l def update_position(self, loc): - 'Set the location of tick in data coords with scalar loc' - y = loc - - nonlinear = (hasattr(self.axes, 'yaxis') and - self.axes.yaxis.get_scale() != 'linear' or - hasattr(self.axes, 'xaxis') and - self.axes.xaxis.get_scale() != 'linear') - + 'Set the location of tick in data coords with scalar *loc*' if self.tick1On: - self.tick1line.set_ydata((y,)) + self.tick1line.set_ydata((loc,)) if self.tick2On: - self.tick2line.set_ydata((y,)) + self.tick2line.set_ydata((loc,)) if self.gridOn: - self.gridline.set_ydata((y, )) + self.gridline.set_ydata((loc,)) if self.label1On: - self.label1.set_y(y) + self.label1.set_y(loc) if self.label2On: - self.label2.set_y(y) - if nonlinear: - self.tick1line._invalid = True - self.tick2line._invalid = True - self.gridline._invalid = True + self.label2.set_y(loc) self._loc = loc self.stale = True