Setting right spine position to 'zero' locates spine at +1

Hi all-

I’ve been working on a plot that puts the bottom and right spines at zero (adapting some code from the example at http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html) , and I’ve discovered that setting the position of the right spine to ‘zero’ seems to locate it at x=1.

Is this a bug? Or is there something that I’m missing?

Thanks,

–Chad

P.S. Sorry if this is duplicated… it seems that my messages aren’t getting though to the list.

Here’s an example that demonstrates the behavior:

import matplotlib.pyplot as plt

f=plt.figure(1)
ax=plt.subplot(111)
ax.spines[‘left’].set_color(‘none’)
ax.spines[‘top’].set_color(‘none’)
ax.spines[‘right’].set_position(‘zero’)
ax.spines[‘bottom’].set_position(‘zero’)

ax.xaxis.set_ticks_position(‘bottom’)
ax.yaxis.set_ticks_position(‘right’)
ax.set_xlim([-2,2])
ax.set_ylim([-2,2])

plt.show()

2013/4/26 Chad Parker <parker.charles@…287…>

···

Hi all-

I’ve been working on a plot that puts the bottom and right spines at zero (adapting some code from the example at http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html) , and I’ve discovered that setting the position of the right spine to ‘zero’ seems to locate it at x=1.

Is this a bug? Or is there something that I’m missing?

It looks like a bug to me, set_position(‘data’, x) puts the spine at x + 1 instead of x.

Goyo