Re: [Matplotlib-users] ugly arrow with xpdf
I finally committed this fix. -- Jouni K. Seppänen http://www.iki.fi/jks - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ugly arrow with xpdf
On Mon, Jun 02, 2008 at 11:17:44PM +0300, Jouni K. Seppänen wrote: > I can confirm this in at least version 0.91.3. The problem seems to be > caused by the midpoint of the stem being included in the path twice in a > row. The following patch removes the midpoint altogether and fixes the > rendering problem at least on my version of xpdf. I'm kind of swamped > right now, so I hope someone else can check whether this breaks any > other uses of arrows, or some other backend. (If this doesn't seem to > happen, please file a bug report in the tracker so it isn't forgotten.) > The patch is against the maintenance branch, but the trunk has > similar-looking code. Thank you very much. It works for me too. > Index: lib/matplotlib/patches.py > === > --- lib/matplotlib/patches.py (revision 5366) > +++ lib/matplotlib/patches.py (working copy) > @@ -634,7 +634,13 @@ > if shape == 'right': > coords = right_half_arrow > elif shape == 'full': > - > coords=npy.concatenate([left_half_arrow,right_half_arrow[::-1]]) > +# Concatenating the full paths caused the midpoint > +# of the stem to be included twice, which was > +# rendered badly by xpdf. Since the point is right > +# between the corners of the stem, we can drop it > +# from both halves. > +coords=npy.concatenate([left_half_arrow[:-1], for the most recent svn version: npy => np > +right_half_arrow[-2::-1]]) > else: > raise ValueError, "Got unknown shape: %s" % shape > cx = float(dx)/distance By, Friedrich - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ugly arrow with xpdf
I can confirm this in at least version 0.91.3. The problem seems to be caused by the midpoint of the stem being included in the path twice in a row. The following patch removes the midpoint altogether and fixes the rendering problem at least on my version of xpdf. I'm kind of swamped right now, so I hope someone else can check whether this breaks any other uses of arrows, or some other backend. (If this doesn't seem to happen, please file a bug report in the tracker so it isn't forgotten.) The patch is against the maintenance branch, but the trunk has similar-looking code. Index: lib/matplotlib/patches.py === --- lib/matplotlib/patches.py (revision 5366) +++ lib/matplotlib/patches.py (working copy) @@ -634,7 +634,13 @@ if shape == 'right': coords = right_half_arrow elif shape == 'full': - coords=npy.concatenate([left_half_arrow,right_half_arrow[::-1]]) +# Concatenating the full paths caused the midpoint +# of the stem to be included twice, which was +# rendered badly by xpdf. Since the point is right +# between the corners of the stem, we can drop it +# from both halves. +coords=npy.concatenate([left_half_arrow[:-1], +right_half_arrow[-2::-1]]) else: raise ValueError, "Got unknown shape: %s" % shape cx = float(dx)/distance -- Jouni K. Seppänen http://www.iki.fi/jks - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ugly arrow with xpdf
Friedrich Hagedorn <[EMAIL PROTECTED]> writes: > % xpdf foo.pdf > > then I see on the startpoint an ugly pike. With gv and evince > everything is ok. Just to be sure about what the problem is, could you show us a screenshot of the ugly rendering, and another of a better rendering in another viewer? I think the list doesn't accept attachments, so it would be best if you could put the files somewhere on the web and send a link to the list or, failing that, send the screenshots to me by email. Also, what exact version of xpdf are you using? -- Jouni K. Seppänen http://www.iki.fi/jks - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] ugly arrow with xpdf
Hello, when I create an arrow with >>> from pylab import * >>> subplot(111) >>> arrow(.5, .5, -.05, .02, lw=5, width=.01) >>> savefig('foo.pdf') and view it with % xpdf foo.pdf then I see on the startpoint an ugly pike. With gv and evince everything is ok. Any idea how to fix it in mpl? Because I dont want to switch to an other viewer then xpdf. Thanks, Friedrich - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users