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

Skip to content
Open
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
11 changes: 11 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,14 @@ def __clear(self):
# deprecation on cla() subclassing expires.

# stash the current visibility state

# A twinx-copied axis title set to the right will move back the
# left if it is cleared.
set_right_label_again = False
if 'y' in self._axis_map:
set_right_label_again = \
(self._axis_map['y'].get_label_position() == 'right')

if hasattr(self, 'patch'):
patch_visible = self.patch.get_visible()
else:
Expand Down Expand Up @@ -1378,6 +1386,9 @@ def __clear(self):
axis._set_lim(0, 1, auto=True)
self._update_transScale()

if set_right_label_again:
self._axis_map['y'].set_label_position('right')

self.stale = True

def clear(self):
Expand Down