|
From: Lebostein <Leb...@gm...> - 2008-12-16 07:52:49
|
Hi, with the new version of matplotlib, the legend looks different in png and pdf! I could post examples, but you can look in the galery also: http://matplotlib.sourceforge.net/gallery.html for example the legend_demo3 http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html * PNG: http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.hires.png * PDF: http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.pdf You see in the png the lines are short and not vertically centered, padding between axes an legend text are ignored .. and so on -- View this message in context: http://www.nabble.com/different-PNG-and-PDF-output...-tp21028686p21028686.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Michael D. <md...@st...> - 2008-12-16 15:56:15
|
This looks like a dpi issue -- that is the only difference between the regular and hi-res png. Jae-Joon -- do you have any thoughts? Perhaps something is dpi-dependent in the new legend code where it shouldn't be? Mike Lebostein wrote: > Hi, > > with the new version of matplotlib, the legend looks different in png and > pdf! > > I could post examples, but you can look in the galery also: > http://matplotlib.sourceforge.net/gallery.html > > for example the legend_demo3 > http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html > * PNG: > http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.hires.png > * PDF: > http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.pdf > > You see in the png the lines are short and not vertically centered, padding > between axes an legend text are ignored .. and so on > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: jkitchin <jki...@an...> - 2008-12-16 17:17:34
|
I also observed this with eps output. The png looked fine, but the eps legend was very large in my case. j Lebostein wrote: > > Hi, > > with the new version of matplotlib, the legend looks different in png and > pdf! > > I could post examples, but you can look in the galery also: > http://matplotlib.sourceforge.net/gallery.html > > for example the legend_demo3 > http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html > * PNG: > http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.hires.png > * PDF: > http://matplotlib.sourceforge.net/_static/plot_directive/mpl_examples/pylab_examples/legend_demo3.pdf > > You see in the png the lines are short and not vertically centered, > padding between axes an legend text are ignored .. and so on > -- View this message in context: http://www.nabble.com/different-PNG-and-PDF-output...-tp21028686p21037465.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-16 19:40:30
|
On Tue, Dec 16, 2008 at 12:17 PM, jkitchin <jki...@an...> wrote: > > I also observed this with eps output. The png looked fine, but the eps legend > was very large in my case. > > j > Hmm, it is not clear to me if this is a same issue. I think eps output is not very sensitive to dpi thing in matplotlib. I tried a few tests but couldn't see any obvious problems. If my patch does not fix your problem, please report some more details. Regards, -JJ |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-16 19:28:23
Attachments:
legend_dpi.patch
|
I just found my previous message was only sent to Lebostein. Anyhow, here is my original meesage. On Tue, Dec 16, 2008 at 10:38 AM, Jae-Joon Lee <lee...@gm...> wrote: > Yes, I can see the differences. > Anyway, it seems to me the differences are primarily caused by > different dpi, not by different backend. > I guess the image in > http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html > is also created with png backend, and that looks okay to me. > And I'm afraid that I didn't correctly accounted the figure dpi when I > calculate these dimensions. > I'll try to correct this soon. > > Thanks. > > -JJ > > And, Micheal, yes, it is a dpi issue. I was using font size in "points" as a reference while it should be in "pixels". This should be fixed both in the maintenance branch and in the trunk. So, Lebostein and j, if you know how to check out using svn, can you give a try either the svn trunk or the maintenance branch? I'm attaching the patch just in case. Regards, -JJ |
|
From: Jouni K. S. <jk...@ik...> - 2008-12-16 21:02:31
|
"Jae-Joon Lee" <lee...@gm...> writes: > So, Lebostein and j, if you know how to check out using svn, can you > give a try either the svn trunk or the maintenance branch? I'm > attaching the patch just in case. On the svn trunk, the demo examples/api/legend_demo.py now fails at "leg.get_texts()" with "AttributeError: 'Legend' object has no attribute 'texts'". Calling show() seems to fix the legend so that get_texts works, so I suspect that the bug is related to the _init_legend_box call that your patch removes. -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-16 22:50:30
|
On Tue, Dec 16, 2008 at 4:02 PM, Jouni K. Seppänen <jk...@ik...> wrote: > "Jae-Joon Lee" <lee...@gm...> writes: > >> So, Lebostein and j, if you know how to check out using svn, can you >> give a try either the svn trunk or the maintenance branch? I'm >> attaching the patch just in case. > > On the svn trunk, the demo examples/api/legend_demo.py now fails at > "leg.get_texts()" with "AttributeError: 'Legend' object has no attribute > 'texts'". Calling show() seems to fix the legend so that get_texts > works, so I suspect that the bug is related to the _init_legend_box call > that your patch removes. > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > I also see the problem. And, yes, this is related with _init_legend_box. As the paddings and such need to be determined at drawing time, I moved this into the draw() method. The fix may involve some rearrangement of the code. I'll work on it. Thanks, -JJ > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-17 01:06:43
|
This should now be fixed (maintenance & trunk). John, I guess I found what I did wrong last time. I used emacs svn interface for committing and it seems that some of the properties are not properly committed. This time, I simply used the shell command. let me know if I messed up again. -JJ ps. John, are you releasing a new maintenance version? I'm afraid that my previous patch broke one of the example. Sorry, I thought the fix was obvious and didn't pay much attention. On Tue, Dec 16, 2008 at 5:18 PM, Jae-Joon Lee <lee...@gm...> wrote: > On Tue, Dec 16, 2008 at 4:02 PM, Jouni K. Seppänen <jk...@ik...> wrote: >> "Jae-Joon Lee" <lee...@gm...> writes: >> >>> So, Lebostein and j, if you know how to check out using svn, can you >>> give a try either the svn trunk or the maintenance branch? I'm >>> attaching the patch just in case. >> >> On the svn trunk, the demo examples/api/legend_demo.py now fails at >> "leg.get_texts()" with "AttributeError: 'Legend' object has no attribute >> 'texts'". Calling show() seems to fix the legend so that get_texts >> works, so I suspect that the bug is related to the _init_legend_box call >> that your patch removes. >> >> -- >> Jouni K. Seppänen >> http://www.iki.fi/jks >> > > I also see the problem. > And, yes, this is related with _init_legend_box. As the paddings and > such need to be determined at drawing time, I moved this into the > draw() method. > The fix may involve some rearrangement of the code. > I'll work on it. > > Thanks, > > -JJ > > > >> >> ------------------------------------------------------------------------------ >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. >> The future of the web can't happen without you. Join us at MIX09 to help >> pave the way to the Next Web now. Learn more and register at >> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
|
From: John H. <jd...@gm...> - 2008-12-17 03:50:29
|
On Tue, Dec 16, 2008 at 7:06 PM, Jae-Joon Lee <lee...@gm...> wrote: > ps. John, are you releasing a new maintenance version? I'm afraid that > my previous patch broke one of the example. Sorry, I thought the fix > was obvious and didn't pay much attention. Yes, and I had just completed a round of testing when I saw your patch come in and included it w/o further testing (stupid). In any case, there are still a couple of bug fixes and optimizations that are in progress, and I will continue to push these out as they become available. The tarball and OSX binaries will soon be almost fully automated, and when we stabilize the 98.5 branch, Charlie can post an update to the win32 binaries. I plan to cut another bugfix release tomorrow in any case. JDH |
|
From: Lebostein <Leb...@gm...> - 2008-12-20 23:02:54
|
OK, now it works! Thank you! A little thing: the shadow of the legend box is not scaling with the dpi. For example with 300 dpi I can't discover the shadow... -- View this message in context: http://www.nabble.com/different-PNG-and-PDF-output...-tp21028686p21109783.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-21 04:16:42
|
On Sat, Dec 20, 2008 at 6:02 PM, Lebostein <Leb...@gm...> wrote: > A little thing: the shadow of the legend box is not scaling with the dpi. > For example with 300 dpi I can't discover the shadow... This also should be fixed in the maintenance branch and the trunk. Thanks for reporting. -JJ |