On 11/9/10 9:21 AM, Benjamin Root wrote:

> I just tested out the patch, and while it did seem to fix the problem for me
> on the test script, I am not 100% certain that it is properly lined up
> (maybe an off-by-one-pixel error?).  Anyway, I tried zooming in to see which
> kind of error it was and I got a very weird image.  I am not certain exactly
> what triggers it, but I think if the rubber-banding does not incorporate the
> entire arrow-head, then the distortion appears.  I was also able to
> reproduce the distortion without the patch (although I think it was easier
> to cause with the patch).

If it looks like an off-by-one pixel error, make sure you are doing:

import matplotlib
matplotlib.rcParams['path.snap'] = False

to turn off the pixel-snapping that happens with horizontal and vertical 
lines in png images, or make sure you are seeing the off-by-one in a 
vector graphic format like pdf.  For me, saving a pdf with the slanted 
line a linewidth of .01 showed that the arrow is right on it now.

I did notice one thing that did seem a little off, though.  I see that 
the tip of the arrow just barely projects over the corner of the box. 
The arrow is supposed to go to (1,1), and the linewidth is 30, so I'm 
thinking that the miter join should project a long ways over the box 
(because the centers of the lines are at (1,1), and the line width is 
very large).  If I change the path_effects argument to:

path_effects=[Stroke(joinstyle='miter'),Stroke(linewidth=1,foreground='w',joinstyle='miter')]

so that I see more clearly where the actual line center is, it appears 
that the line center is far off of (1,1).  I guess at this point, I'm 
confused about how the arrow is supposed to be representing the segment 
between (0,0) and (1,1).  Is the tip of the arrow (after the miter join) 
supposed to hit (1,1), or is the center of the line supposed to hit 
(1,1)?  Or maybe the tip of the joinstyle='round' arrow (the default) is 
supposed to hit (1,1)?

I noticed this bug when I was trying to figure out a way to have the 
actual drawn arrow end at a specific point (maybe using miter join, so 
that we had a sharp arrow) for Sage.  It would be nice if there was some 
sort of option that would do the math to shorten the arrow by the 
necessary amount.  Of course, if that's not an option, I could do that 
math myself in Sage's "arrow" wrapper command.

Thanks,

Jason




------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to