axes.frame not drawn while axes.draw() called

Hello,

I just noticed that,if I use imshow(), part of axes border is not
clearly visible (the image hides the border).
And this seems to be due to the following changes in axes.draw()
method made in r5882.

--- lib/matplotlib/axes.py (revision 5881)
+++ lib/matplotlib/axes.py (revision 5882)
@@ -1503,8 +1503,6 @@
         artists.extend(self.tables)
         if self.legend_ is not None:
             artists.append(self.legend_)
- if self.axison and self._frameon:
- artists.append(self.frame)

         dsu = [ (a.zorder, i, a) for i, a in enumerate(artists)
                 if not a.get_animated() ]

Don't we need axes.frame to be drawn? Recovering those two lines
solved my problem.
Regards,

-JJ

apparently the frame drawing code was in Axes.draw and Paul removed
the 2nd instance of it. The first instance (which is the one that
remains) draws the frame under the artists, and the 2nd instance (the
one you want restored) draws the frame above the artists. I tend to
agree that it is the 2nd one we want. Does anyone have a different
opinion before I fix this?

JDH

Apparently someone moved the frame drawing code to be earlier so it
would be under the artists.

···

On Mon, Jul 28, 2008 at 9:26 AM, Jae-Joon Lee <lee.j.joon@...149...> wrote:

Hello,

I just noticed that,if I use imshow(), part of axes border is not
clearly visible (the image hides the border).
And this seems to be due to the following changes in axes.draw()
method made in r5882.

--- lib/matplotlib/axes.py (revision 5881)
+++ lib/matplotlib/axes.py (revision 5882)
@@ -1503,8 +1503,6 @@
        artists.extend(self.tables)
        if self.legend_ is not None:
            artists.append(self.legend_)
- if self.axison and self._frameon:
- artists.append(self.frame)

        dsu = [ (a.zorder, i, a) for i, a in enumerate(artists)
                if not a.get_animated() ]

Don't we need axes.frame to be drawn? Recovering those two lines
solved my problem.

Hi John,

I'm a bit confused. When you say 1st instance, you mean

        if self.axison and self._frameon:
            self.patch.draw(renderer)

at line 1452?
And you're saying that you tend to keep only the second instance,
instead of both?
(I'm sorry if I misunderstood you. I often have problems with my english)

I guess we need both. What I see is that self.patch is for axes
background (a "filled" patch), and self.frame is for axes border (a
patch with facecolor="none"). Aren't they?
(We may have self.patch.set_edgecolor("none") explicitly though).

Regards,

-JJ

···

On Mon, Jul 28, 2008 at 10:45 AM, John Hunter <jdh2358@...149...> wrote:

On Mon, Jul 28, 2008 at 9:26 AM, Jae-Joon Lee <lee.j.joon@...149...> wrote:

Hello,

I just noticed that,if I use imshow(), part of axes border is not
clearly visible (the image hides the border).
And this seems to be due to the following changes in axes.draw()
method made in r5882.

--- lib/matplotlib/axes.py (revision 5881)
+++ lib/matplotlib/axes.py (revision 5882)
@@ -1503,8 +1503,6 @@
        artists.extend(self.tables)
        if self.legend_ is not None:
            artists.append(self.legend_)
- if self.axison and self._frameon:
- artists.append(self.frame)

        dsu = [ (a.zorder, i, a) for i, a in enumerate(artists)
                if not a.get_animated() ]

Don't we need axes.frame to be drawn? Recovering those two lines
solved my problem.

apparently the frame drawing code was in Axes.draw and Paul removed
the 2nd instance of it. The first instance (which is the one that
remains) draws the frame under the artists, and the 2nd instance (the
one you want restored) draws the frame above the artists. I tend to
agree that it is the 2nd one we want. Does anyone have a different
opinion before I fix this?

JDH

Apparently someone moved the frame drawing code to be earlier so it
would be under the artists.

Sorry, I was confused. I misread the first patch drawing as a frame
drawing. I am adding the frame back in. Paul removed it in the
commit

  r5882 | pkienzle | 2008-07-25 19:01:18 -0500 (Fri, 25 Jul 2008) | 1 line

  Fix contains() for lines; don't redraw axis frame

Paul, were you also mistaking the patch for the frame? I looked at
the Axes code and noticed the patch was drawing the edge, which is the
job of the frame. I am turning the patch edgecolor off by default,
which is what I think it should be doing, but Eric, can you confirm?

JDH

···

On Mon, Jul 28, 2008 at 10:30 AM, Jae-Joon Lee <lee.j.joon@...149...> wrote:

Hi John,

I'm a bit confused. When you say 1st instance, you mean

       if self.axison and self._frameon:
           self.patch.draw(renderer)

at line 1452?