Hi all,

If you zoom in to the origin in the following figure:

fig = plt.figure()
ax = fig.add_subplot(1,1,1, aspect='equal')
ax.plot([-1,1],[-1,1], color='blue')
ax.set_xlim(-1.1,1.1)
ax.set_ylim(-1.1,1.1)
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
fig.savefig('test.png',dpi=300)

you'll see that the blue line isn't quite centered at the origin (at 
least the origin marked by the spines).  It appears to hit just above or 
just to the left of the origin.  Notice that there is a bit of blue 
coloring in the second quadrant, but none in the fourth.  Notice also 
that there are more pixels colored just below the x-axis in quadrant 3 
than just above the axis in quadrant 1.

Several of us Sage developers have been practically pulling out our hair 
trying to trace down why our plots seem to be shifted up or to the left 
by a pixel or so.  I think the above example illustrates what is going on.

Any ideas as to what is going on?  I'm not sure if the problem is with 
the line or with the spines.  The lines ax.plot([-1,1],[0,0]) and 
ax.plot([0,0],[-1,1]) seem to be right on center with the spines.

Thanks,

Jason

--
Jason Grout


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to