On 6/11/10 9:44 AM, Michael Droettboom wrote:
> On 06/11/2010 09:46 AM, Michael Droettboom wrote:
>    
>> However, there's actually a bug in the quantizer that your example
>> illustrates.  Since the spine lines in your example have a stroke width
>> of 4 pixels, they should actually be rounded to the nearest pixel edge,
>> not nearest center pixel.  So the quantizing is causing this slight
>> alignment problem *and* making the straight lines look fuzzier than they
>> should.  I'm planning on writing a patch that will take stroke width
>> into account to address this.  By coincidence only, this will also make
>> your example plot look more accurate (but that's dependent on the
>> specific scale being used).
>>
>>      
> This specific bug is fixed in r8414.
>
> Mike
>
>    

I tested your fix, and now this example gives the same sort of problem 
(note that in this case, the spine is 1 pixel wide; I've just changed 
the dpi):

from matplotlib import pyplot as plt
import numpy as np
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=100)

It appears that the true origin is at the top left corner of the 1-pixel 
intersection of the two spines in the above example.

Thanks again for your work on this!

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

Reply via email to