On 6/11/10 1:02 PM, Michael Droettboom wrote: > >> It appears that the difficulty is that quantization is exposed at the >> python level only for collections, via iter_segments. >> >> > Sort of. Lines (but none of the other artists) follow what is set by > "set_snap" (the use of two terms for the same thing is also a problem, > of course). This needs to be extended to other artists (and other > relevant backend methods other than draw_path, if necessary). But I > think for convenience, it should also be a global rcParam.
I think a work-around, then (at least it seems to work for me), is setting both snap to False and antialiased to False for the spines. That won't solve the issue for other horizontal lines, but at least it takes care of having the correct origin for the intersection of the spines. (Correct me if I'm wrong, of course!) from matplotlib import pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1, aspect='equal') line1=ax.plot([-1,1],[0,0], color='blue') line2=ax.plot([-1,1],[-1,1], color='red',zorder=5) ax.set_xlim(-1.1,1.1) ax.set_ylim(-1.1,1.1) ax.spines['left'].set_position('zero') ax.spines['left'].set_snap(False) ax.spines['left'].set_antialiased(False) ax.spines['right'].set_color('none') ax.spines['bottom'].set_position('zero') ax.spines['bottom'].set_snap(False) ax.spines['bottom'].set_antialiased(False) ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') fig.savefig('test.png',dpi=100) Thanks, Jason ------------------------------------------------------------------------------ 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