Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 33408fa

Browse filesBrowse files
committed
Re-order drawing of spines and axis objects.
This gives the spine a chance to update the axis object before draw. This is sensible given that the axis can be registered with the spine so that it can modify it, and is necessary for some use cases.
1 parent be8cc30 commit 33408fa
Copy full SHA for 33408fa

File tree

Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,14 @@ def draw(self, renderer=None, inframe=False):
19771977
artists.extend(self.lines)
19781978
artists.extend(self.texts)
19791979
artists.extend(self.artists)
1980+
1981+
# the frame draws the edges around the axes patch -- we
1982+
# decouple these so the patch can be in the background and the
1983+
# frame in the foreground. Do this before drawing the axis
1984+
# objects so that the spine has the opportunity to update them.
1985+
if self.axison and self._frameon:
1986+
artists.extend(six.itervalues(self.spines))
1987+
19801988
if self.axison and not inframe:
19811989
if self._axisbelow:
19821990
self.xaxis.set_zorder(0.5)
@@ -1993,12 +2001,6 @@ def draw(self, renderer=None, inframe=False):
19932001
if self.legend_ is not None:
19942002
artists.append(self.legend_)
19952003

1996-
# the frame draws the edges around the axes patch -- we
1997-
# decouple these so the patch can be in the background and the
1998-
# frame in the foreground.
1999-
if self.axison and self._frameon:
2000-
artists.extend(six.itervalues(self.spines))
2001-
20022004
if self.figure.canvas.is_saving():
20032005
dsu = [(a.zorder, a) for a in artists]
20042006
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.