Sunday 15 June 2014

Python Matplotlib runtime error upon closing the console -


I'm trying to create a bar with matplotlib on dragon tkinter. Everything works fine when I get the message of the tanker (console), it gives me this message.

Enter image details here

I turned off my console I have already closed my tanker window so I am not sure which process it is referring to "still running" when I choose to kill it then give me this error message: < P> Enter image details here

This only occurs when I have my matplotlib Code is embedded when I get up Mr. script I cast my matplotlib code, it does not give me now the message and work properly. My code is as follows:

import my script

  or Tnkinr imports as imported importer matplotlib matplotlib.use ( 'TkAgg' ) import numpy as np import Matplotlibkpyplot Plt Import Import as mlab the matlotlib.backends.backend_tkagg imports as matplotlib.mlab, in NavigationToolbar2TkAgg import matplotlib.backend_bases to key_press_handler import matplotlib.figure import datetime import import datetime datetime   

Matplotlib related code

  Frame = tk.Frame (Guardian, wide = 900, height = 500, BG = 'Laitgrin, relief =' Groove ', BD = 1) frame. Place (x = 10, y = 10) FIG = Pltkfigure () AX = fig.add_subplot (211) canvas = Akritikanwastakag (fig, master = frame) Kanwaskso () Kanwasktet_tike_viviget () Kpak (side = 'tOP' filled = "both", width = 1) Kanwask_ Tkcanvaskpack (side = "top", fill = 'both', width = 1) toolbar = navigation toolbar 2 Tikeajiji (canvas frame) toolbar .update () canvas._tkcanvas.pack (side = "top", fill = 'both', detail = 1) def on_key_event (event): key_press_handle (event, canvas, toolbar)   

Problems Or what is happening

I am using Window 8 (64 bit) with Python 2.7.4, matplotlib 1.2.0 (64 beats) Python 2.7

You have running multiple GUI event loops (one of you TK, and a plt starts) plt < For a way to properly embed / code> or mlab not import Tk , see.

You need to change this line by default

  fig = PLT.figger ()   

to

Fig / Figure ()

and get rid of plt in your import.

No comments:

Post a Comment