From: Benjamin R. <ben...@ou...> - 2014-11-15 16:14:57
|
I was working on my embedding chapter of my book when I noticed a subtle difference in the tkagg backend from other interactive backends. First, all other interactive Canvas classes inherit their respective backend's widget: ``` ben@tigger:~/Programs/matplotlib$ git grep "FigureCanvasBase" | grep "class " lib/matplotlib/backend_bases.py:class FigureCanvasBase(object): lib/matplotlib/backends/backend_agg.py:class FigureCanvasAgg(FigureCanvasBase): lib/matplotlib/backends/backend_cairo.py:class FigureCanvasCairo (FigureCanvasBase): lib/matplotlib/backends/backend_gdk.py:class FigureCanvasGDK (FigureCanvasBase): lib/matplotlib/backends/backend_gtk.py:class FigureCanvasGTK (gtk.DrawingArea, FigureCanvasBase): lib/matplotlib/backends/backend_gtk3.py:class FigureCanvasGTK3 (Gtk.DrawingArea, FigureCanvasBase): lib/matplotlib/backends/backend_macosx.py:class FigureCanvasMac(_macosx.FigureCanvas, FigureCanvasBase): lib/matplotlib/backends/backend_pdf.py:class FigureCanvasPdf(FigureCanvasBase): lib/matplotlib/backends/backend_pgf.py:class FigureCanvasPgf(FigureCanvasBase): lib/matplotlib/backends/backend_ps.py:class FigureCanvasPS(FigureCanvasBase): lib/matplotlib/backends/backend_qt5.py:class FigureCanvasQT(QtWidgets.QWidget, FigureCanvasBase): lib/matplotlib/backends/backend_svg.py:class FigureCanvasSVG(FigureCanvasBase): lib/matplotlib/backends/backend_template.py:class FigureCanvasTemplate(FigureCanvasBase): lib/matplotlib/backends/backend_wx.py:class FigureCanvasWx(FigureCanvasBase, wx.Panel): ``` (I am going to assume that _macosx.FigureCanvas has all needed things built-in, and I'll ignore the switched order for FigureCanvasWx). I have no clue if this is potentially an issue or not, it just seemed a bit inconsistent. Second, while I haven't tried out all the backends yet, I noticed that the Figure window for tkagg has an annoying border that the other backends don't have. It is fairly wide, 4 pixels. I would like to get rid of that. Does anybody object to that? I can make a PR for that and any other border widths I find. Cheers! Ben Root |
From: Eric F. <ef...@ha...> - 2014-11-15 17:08:50
|
On 2014/11/15, 6:14 AM, Benjamin Root wrote: > I was working on my embedding chapter of my book when I noticed a subtle > difference in the tkagg backend from other interactive backends. First, > all other interactive Canvas classes inherit their respective backend's > widget: > > ``` > ben@tigger:~/Programs/matplotlib$ git grep "FigureCanvasBase" | grep > "class " > lib/matplotlib/backend_bases.py:class FigureCanvasBase(object): > lib/matplotlib/backends/backend_agg.py:class > FigureCanvasAgg(FigureCanvasBase): > lib/matplotlib/backends/backend_cairo.py:class FigureCanvasCairo > (FigureCanvasBase): > lib/matplotlib/backends/backend_gdk.py:class FigureCanvasGDK > (FigureCanvasBase): > lib/matplotlib/backends/backend_gtk.py:class FigureCanvasGTK > (gtk.DrawingArea, FigureCanvasBase): > lib/matplotlib/backends/backend_gtk3.py:class FigureCanvasGTK3 > (Gtk.DrawingArea, FigureCanvasBase): > lib/matplotlib/backends/backend_macosx.py:class > FigureCanvasMac(_macosx.FigureCanvas, FigureCanvasBase): > lib/matplotlib/backends/backend_pdf.py:class > FigureCanvasPdf(FigureCanvasBase): > lib/matplotlib/backends/backend_pgf.py:class > FigureCanvasPgf(FigureCanvasBase): > lib/matplotlib/backends/backend_ps.py:class > FigureCanvasPS(FigureCanvasBase): > lib/matplotlib/backends/backend_qt5.py:class > FigureCanvasQT(QtWidgets.QWidget, FigureCanvasBase): > lib/matplotlib/backends/backend_svg.py:class > FigureCanvasSVG(FigureCanvasBase): > lib/matplotlib/backends/backend_template.py:class > FigureCanvasTemplate(FigureCanvasBase): > lib/matplotlib/backends/backend_wx.py:class > FigureCanvasWx(FigureCanvasBase, wx.Panel): > ``` > (I am going to assume that _macosx.FigureCanvas has all needed things > built-in, and I'll ignore the switched order for FigureCanvasWx). I have > no clue if this is potentially an issue or not, it just seemed a bit > inconsistent. There are a lot of differences; I don't know whether it would even be possible to make TkAgg more similar to the others. One of the differences is that most of the others have a native part (e.g., backend_qt5) and the part that pulls in agg (e.g., backend_qt5agg). TkAgg does it all in one. I don't think the difference is problematic. > > Second, while I haven't tried out all the backends yet, I noticed that > the Figure window for tkagg has an annoying border that the other > backends don't have. It is fairly wide, 4 pixels. I would like to get > rid of that. Does anybody object to that? I can make a PR for that and > any other border widths I find. Offhand, sounds reasonable. Eric > > Cheers! > Ben Root > > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > |
From: Daniele N. <da...@gr...> - 2015-06-15 08:49:26
|
Hello Ben, On 15/11/14 17:14, Benjamin Root wrote: > Second, while I haven't tried out all the backends yet, I noticed that > the Figure window for tkagg has an annoying border that the other > backends don't have. It is fairly wide, 4 pixels. I would like to get > rid of that. Does anybody object to that? I can make a PR for that and > any other border widths I find. I'm trying to switch from the MacOSX backend to the the WXAgg backend because the font handling in the first is quite a bit broken. However the black border is very annoying. Did you manage to get rid of it? Cheers, Daniele |
From: Benjamin R. <ben...@ou...> - 2015-06-15 11:23:46
|
That's the weird thing... I couldn't! I tried a few different things and I couldn't make it go away. I'll probably give it another shot during scipy2015. Ben Root On Jun 15, 2015 4:50 AM, "Daniele Nicolodi" <da...@gr...> wrote: > Hello Ben, > > On 15/11/14 17:14, Benjamin Root wrote: > > Second, while I haven't tried out all the backends yet, I noticed that > > the Figure window for tkagg has an annoying border that the other > > backends don't have. It is fairly wide, 4 pixels. I would like to get > > rid of that. Does anybody object to that? I can make a PR for that and > > any other border widths I find. > > I'm trying to switch from the MacOSX backend to the the WXAgg backend > because the font handling in the first is quite a bit broken. However > the black border is very annoying. Did you manage to get rid of it? > > Cheers, > Daniele > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > |
From: Jack U. <jui...@ya...> - 2015-06-15 11:46:56
|
Perhaps MEP27 will make that job easier, we shall see... From: Benjamin Root <ben...@ou...> To: Daniele Nicolodi <da...@gr...> Cc: matplotlib development list <mat...@li...> Sent: Monday, 15 June 2015, 13:23 Subject: Re: [matplotlib-devel] Tk backend different from others That's the weird thing... I couldn't! I tried a few different things and I couldn't make it go away. I'll probably give it another shot during scipy2015.Ben Root On Jun 15, 2015 4:50 AM, "Daniele Nicolodi" <da...@gr...> wrote: Hello Ben, On 15/11/14 17:14, Benjamin Root wrote: > Second, while I haven't tried out all the backends yet, I noticed that > the Figure window for tkagg has an annoying border that the other > backends don't have. It is fairly wide, 4 pixels. I would like to get > rid of that. Does anybody object to that? I can make a PR for that and > any other border widths I find. I'm trying to switch from the MacOSX backend to the the WXAgg backend because the font handling in the first is quite a bit broken. However the black border is very annoying. Did you manage to get rid of it? Cheers, Daniele ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-devel mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-devel ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-devel mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |
From: Joe K. <jof...@gm...> - 2015-06-15 13:23:51
|
On Mon, Jun 15, 2015 at 6:23 AM, Benjamin Root <ben...@ou...> wrote: > That's the weird thing... I couldn't! I tried a few different things and I > couldn't make it go away. I'll probably give it another shot during > scipy2015. > I'm guessing, but did you try changing the (Tk) ``highlightthickness``? E.g., something like: widget.config(borderwidth=0, highlightthickness=0) It's a moderately classic Tkinter gotcha. You remove all the borders and there's still one (hightlightthickness) still there, but it only shows up when you interact with the Frame. Hope that helps, -Joe |
From: Benjamin R. <ben...@ou...> - 2015-06-15 13:51:13
|
No, I did not try that one. I'll give it a shot. I don't do any Tkinter programming, so I wasn't familiar with that one. On Mon, Jun 15, 2015 at 9:23 AM, Joe Kington <jof...@gm...> wrote: > > > On Mon, Jun 15, 2015 at 6:23 AM, Benjamin Root <ben...@ou...> wrote: > >> That's the weird thing... I couldn't! I tried a few different things and >> I couldn't make it go away. I'll probably give it another shot during >> scipy2015. >> > I'm guessing, but did you try changing the (Tk) ``highlightthickness``? > E.g., something like: > > widget.config(borderwidth=0, highlightthickness=0) > > It's a moderately classic Tkinter gotcha. You remove all the borders and > there's still one (hightlightthickness) still there, but it only shows up > when you interact with the Frame. > > Hope that helps, > -Joe > |
From: Benjamin R. <ben...@ou...> - 2015-06-15 19:04:34
|
I think that worked! I made a PR: https://github.com/matplotlib/matplotlib/pull/4530 On Mon, Jun 15, 2015 at 9:50 AM, Benjamin Root <ben...@ou...> wrote: > No, I did not try that one. I'll give it a shot. I don't do any Tkinter > programming, so I wasn't familiar with that one. > > On Mon, Jun 15, 2015 at 9:23 AM, Joe Kington <jof...@gm...> > wrote: > >> >> >> On Mon, Jun 15, 2015 at 6:23 AM, Benjamin Root <ben...@ou...> wrote: >> >>> That's the weird thing... I couldn't! I tried a few different things and >>> I couldn't make it go away. I'll probably give it another shot during >>> scipy2015. >>> >> I'm guessing, but did you try changing the (Tk) ``highlightthickness``? >> E.g., something like: >> >> widget.config(borderwidth=0, highlightthickness=0) >> >> It's a moderately classic Tkinter gotcha. You remove all the borders and >> there's still one (hightlightthickness) still there, but it only shows up >> when you interact with the Frame. >> >> Hope that helps, >> -Joe >> > > |