8000 Remove explicit children invalidation in update_position method by Kojoley · Pull Request #6692 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove explicit children invalidation in update_position method #6692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 11 additions & 34 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
0