On Wed, Nov 10, 2010 at 12:21 AM, Benjamin Root <ben.r...@ou.edu> wrote:
> On Tue, Nov 9, 2010 at 7:24 AM, Jae-Joon Lee <lee.j.j...@gmail.com> wrote:
>>
>> Thanks for tracking down this.
>> It turned out to be a silly error while adjusting the line end-point.
>> I'm attaching the patch. Please test the patch if you can.
>> I'll commit the change sometime tomorrow.
>>

Thanks. I can reproduce the problem.

aa = ax.annotate('', (1,1),
                 (-10,-10),
                 arrowprops=dict(arrowstyle="-|>",
                                 fc="w", ec="k",lw=30,
                                 path_effects=[Stroke(joinstyle='miter')])
                 )

The erroneous behavior happens when one tries to draw a path that
connects points far outside of the canvas (point 10,10 in above
example). And this is a AGG-specific issue.  The erroneous behavior
goes away if we clip the path.

aa.arrow_patch.set_clip_box(ax.figure.bbox)

I try to reproduce the problem with simple plot command, but couldn't.
Maybe this happens only for rendering bezier splines?
Michael, any idea?

One thing I may do to prevent it is to set the clip_path of the arrow
to the figure.bbox by default.
I'll think about it.

Regards,

-JJ


>> Regards,
>>
>> -JJ
>>
>>
>> On Tue, Nov 9, 2010 at 9:15 PM, Jason Grout <jason-s...@creativetrax.com>
>> wrote:
>>>
>>> I've been trying to track down a problem in the arrows where the arrow
>>> seems to be off by a little bit.  I've narrowed down the problem to a
>>> small example:
>>>
>>> import matplotlib.patches as mpatches
>>> import matplotlib.pyplot as plt
>>> fig=plt.figure()
>>> ax = fig.add_subplot(111, xlim=(.98,1.02),
>>> ylim=(.98,1.02),aspect='equal')
>>> from matplotlib.patheffects import Stroke
>>>
>>> ax.annotate('', (1,1),
>>>             (0,0),
>>>             arrowprops=dict(arrowstyle="-|>",
>>>                             fc="w", ec="k",lw=30,
>>>                             path_effects=[Stroke(joinstyle='miter')]),)
>>> ax.plot([0,1],[1,1])
>>> ax.plot([1,1],[0,1])
>>> ax.plot([0,1.02],[0,1.02])
>>>
>>> fig.savefig('test.png')
>>>
>>>
>>> I've used a miter join above because it illustrates the problem better.
>>>  Notice that the arrowhead tip is just below the line, but should be
>>> right on the line.  Any clue about what the problem is?
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> --
>>> Jason Grout
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> 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
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
> Jae-Joon,
>
> 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).
>
> Ben Root
>
>

------------------------------------------------------------------------------
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