spines with 'axes' positions show in wrong place?

Do the right and top spines display correctly when the position is set using 'axes' coordinates?

import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.linspace(0,2*np.pi,100)
y = 2*np.sin(x)
ax = fig.add_subplot(1,1,1)
ax.set_title('centered spines')
ax.plot(x,y)
ax.spines['right'].set_position(('axes',0.1))
ax.yaxis.set_ticks_position('right')
ax.spines['top'].set_position(('axes',0.25))
ax.xaxis.set_ticks_position('top')
ax.spines['left'].set_color('none')
ax.spines['bottom'].set_color('none')
fig.savefig('test.png',bbox_inches='tight')

Notice that the top spine is 0.25 in axes coordinates, where 0 in the axes coordinates is the *top* of the picture, and positive goes up. I'd expect that 0.25 in axes coordinates be 25% from the bottom of the picture, or that the coordinates would be reversed for the top spine and the top spine would be positioned 25% from the top of the picture. Having it jump above the picture was a surprise. I noticed the same sort of issue for the right spine, as illustrated above as well.

Of course, it may be that I'm just not understanding something...

Thanks,

Jason

···

--
Jason Grout

Jason,

This looks like a bug. I'll look into it. Please ping me in a few days
if you haven't heard back.

-Andrew

···

jason-sage@...691... wrote:

Do the right and top spines display correctly when the position is set
using 'axes' coordinates?

Andrew Straw wrote:

  

Do the right and top spines display correctly when the position is set using 'axes' coordinates?
  

Jason,

This looks like a bug. I'll look into it. Please ping me in a few days
if you haven't heard back.
  
This is just a friendly ping about the issue in this thread. I'm delaying the patch that shifts Sage's graphics to using the new matplotlib and spines, and I think resolving this issue would probably resolve the remaining big problem (placing axes labels, as mentioned in the thread "setting axis label offset from end of spine").

Thanks,

Jason

···

jason-sage@...691... wrote:

To make sure this doesn't get misplaced, please post it on the bug tracker:

  https://sourceforge.net/tracker/?group_id=80706&atid=560720

and I'll make sure it gets assigned to Andrew :slight_smile:

JDH

···

On Thu, Sep 3, 2009 at 8:05 PM, <jason-sage@...691...> wrote:

This is just a friendly ping about the issue in this thread. I'm
delaying the patch that shifts Sage's graphics to using the new
matplotlib and spines, and I think resolving this issue would probably
resolve the remaining big problem (placing axes labels, as mentioned in
the thread "setting axis label offset from end of spine").

John Hunter wrote:

···

On Thu, Sep 3, 2009 at 8:05 PM, <jason-sage@...691...> wrote:

This is just a friendly ping about the issue in this thread. I'm
delaying the patch that shifts Sage's graphics to using the new
matplotlib and spines, and I think resolving this issue would probably
resolve the remaining big problem (placing axes labels, as mentioned in
the thread "setting axis label offset from end of spine").
    
To make sure this doesn't get misplaced, please post it on the bug tracker:

  https://sourceforge.net/tracker/?group_id=80706&atid=560720

and I'll make sure it gets assigned to Andrew :slight_smile:

Done: https://sourceforge.net/tracker/?func=detail&aid=2852168&group_id=80706&atid=560720

Thanks,

Jason

I fixed this in svn r7638. Thanks for the report.

Can a dev merge r7638 from the v0_99_maint branch into the trunk? I'm
having a hard time figuring out svnmerge and I really don't feel like
fighting it right now. (I read the docs at
http://matplotlib.sourceforge.net/devel/coding_guide.html#using-svnmerge
but I still can't get it to work.)

-Andrew

···

jason-sage@...691... wrote:

https://sourceforge.net/tracker/?func=detail&aid=2852168&group_id=80706&atid=560720

My kids have commandeered my computer for family movie night, but I'll merge this tomorrow if someone else hasn't gotten to it before then. I suspect the amount of time you must have sunk into determining the date dependency of the empty datetime bug has exhausted your free energy for mpl hassles, so I'm happy to take this one.

JDH

···

On Sep 5, 2009, at 7:09 PM, Andrew Straw <strawman@...36...> wrote:

jason-sage@...691... wrote:

https://sourceforge.net/tracker/?func=detail&aid=2852168&group_id=80706&atid=560720

I fixed this in svn r7638. Thanks for the report.

Can a dev merge r7638 from the v0_99_maint branch into the trunk? I'm
having a hard time figuring out svnmerge and I really don't feel like
fighting it right now. (I read the docs at
http://matplotlib.sourceforge.net/devel/coding_guide.html#using-svnmerge
but I still can't get it to work.)

-Andrew