I am trying to utilize some of the functionality that pyplot provides to display some data related to the graph, but on a separate window. The problem I have is that the pyplot window that pops up is uncontrollable, in other words I can not utilize any of the default buttons, or even close it. The code I use is very simple: plt.ion() fig = plt.figure() ax = self.fig.add_subplot(111) x = np.random.normal(0,1,1000) numBins = 50 ax.hist(x,numBins,color='green',alpha=0.8) Any ideas what is going on? Can it be that Gtk and pyplot don't work well together? thanks in advance -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 12.11.2015 01:42, Evangelos Petsalis wrote:
I am trying to utilize some of the functionality that pyplot provides to display some data related to the graph, but on a separate window.
The problem I have is that the pyplot window that pops up is uncontrollable, in other words I can not utilize any of the default buttons, or even close it.
The code I use is very simple: plt.ion() fig = plt.figure() ax = self.fig.add_subplot(111) x = np.random.normal(0,1,1000) numBins = 50 ax.hist(x,numBins,color='green',alpha=0.8)
Any ideas what is going on? Can it be that Gtk and pyplot don't work well together?
I'm not sure what this hast to do with graph-tool. Do things work as expected when you do not import graph-tool? Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Tiago, I am 100% sure it has nothing to do with the graph tool but rather with Gtk backend. I should have probably mentioned that in my first email. The only reason I posted it on the mailing list was because I am sure I can't be the only one who wants to use pyplot from a Gtk-based app that uses the graph-tool. So I was kinda looking for some hints, if anybody has any. Vaggelis On Wed, Nov 11, 2015 at 11:42 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 12.11.2015 01:42, Evangelos Petsalis wrote:
I am trying to utilize some of the functionality that pyplot provides to display some data related to the graph, but on a separate window.
The problem I have is that the pyplot window that pops up is uncontrollable, in other words I can not utilize any of the default buttons, or even close it.
The code I use is very simple: plt.ion() fig = plt.figure() ax = self.fig.add_subplot(111) x = np.random.normal(0,1,1000) numBins = 50 ax.hist(x,numBins,color='green',alpha=0.8)
Any ideas what is going on? Can it be that Gtk and pyplot don't work well together?
I'm not sure what this hast to do with graph-tool. Do things work as expected when you do not import graph-tool?
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
You might want to try asking matplotlib to use another backend : (ex qt4) import matplotlib matplotlib.use('QT4Agg') or, as graph_tool uses gtk3 if I remember correctly, you try to force the import of gtk, see if it helps... (maybe you have two versions of gtk that generate conflicts) Good luck. -- Tanguy Fardet PhD student in Computational Neurosciences MSC Lab - Paris 7 Diderot 911A
On 12.11.2015 17:33, Evangelos Petsalis wrote:
The only reason I posted it on the mailing list was because I am sure I can't be the only one who wants to use pyplot from a Gtk-based app that uses the graph-tool.
I have absolutely no problem using matplotlib with the Gtk+ backend together with graph-tool. You should bring this to the matplotlib mailing list/issue tracker instead. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Do you import the drawing canvas as a widget to a Gtk window or do you use it directly as is (i.e. invoke plot() and be done with it?) And if you don't mind me asking, which backend are you using, GtkAgg? On Thu, Nov 12, 2015 at 1:45 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 12.11.2015 17:33, Evangelos Petsalis wrote:
The only reason I posted it on the mailing list was because I am sure I can't be the only one who wants to use pyplot from a Gtk-based app that uses the graph-tool.
I have absolutely no problem using matplotlib with the Gtk+ backend together with graph-tool.
You should bring this to the matplotlib mailing list/issue tracker instead.
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de> _______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
On 12.11.2015 22:58, Evangelos Petsalis wrote:
Do you import the drawing canvas as a widget to a Gtk window or do you use it directly as is (i.e. invoke plot() and be done with it?)
I use it as it is.
And if you don't mind me asking, which backend are you using, GtkAgg?
I use GTK3Cairo. Please, since his has nothing to do with graph-tool, this is totally off-topic for this list. You should contact the matplotlib community. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (3)
-
Evangelos Petsalis -
Tanguy Fardet -
Tiago de Paula Peixoto