Note that there are some explanatory texts on larger screens.

plurals
  1. POAfter close the plot window the process keeps running
    primarykey
    data
    text
    <p>Im new in matplotlib and having some hard times. From the user point of view everything works fine. I have a window with a button. Pressing the button a new window pops showing the plot. After play with it i click at X to close this window. And click at X again to close the window with the button. BUT im not dropped back to a free prompt. The main window is locked and still running in background.</p> <p>Here goes the important parts of code:</p> <pre><code>import matplotlib import matplotlib.pyplot as Plt from matplotlib.figure import Figure class MainPanel(wx.Panel): def __init__(self, parent): #=None wx.Panel.__init__(self, parent) .... wxpython stuff goes here.... self.btn1.Bind(wx.EVT_BUTTON, self.cplot) .... def cplot(self, event): self.new = NewWindow(self) self.new.cidadeplot(self) self.new.Show() return class NewWindow(wx.Frame): def __init__(self,event): wx.Frame.__init__(self, None, -1, 'Plot', size=(556, 618)) wx.Frame.CenterOnScreen(self) self.Bind(wx.EVT_CLOSE, self.OnClose) def OnClose(self,event): self.Destroy() def cidplot(self,event): self.fig = Figure() self.axes = self.fig.add_subplot(111) self.canvas = FigCanvas(self, -1, self.fig) self.axes.set_ylabel("Parts") self.axes.set_ylim(0,100) self.axes.grid(True) ....more axes settings... bars = self.axes.bar(left=self.ii, height=self.tt, width=0.2, align='center', alpha=0.8) .... self.canvas.draw() Plt.savefig("Parts.pdf", dpi=300) class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title = "System Test") self.SetSize((556, 618)) panel = MainPanel(self) self.Show() if __name__ == "__main__": app = wx.App(False) frame = MainFrame() app.MainLoop() </code></pre> <p>I think the problem is at self.fig = Figure() (Same happens if i use Plt.figure())</p> <p>Im doing something wrong when i create a new window or is at my matplotlib part? Some better way to do it?</p> <p>Thanks in advance. Any ideia is welcome.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload