Re: [Matplotlib-users] Matplotlib, Tk, and multithreading

2013-03-14 Thread Benjamin Root
On Wed, Mar 13, 2013 at 9:43 PM, Oliver King oliver.afr...@gmail.comwrote: Hi, I have a library which uses matplotlib to produce some plots. This library is called by a thread. However, python crashes with this error when it tries to plot something: Tk_MacOSXSetupTkNotifier: first [load]

Re: [Matplotlib-users] Matplotlib, Tk, and multithreading

2013-03-14 Thread Oliver King
Hi Ben, Are you displaying the plots in the thread, or are you just saving the plots directly? If you are saving them directly, then you can set your backend to be Agg and get rid of the Tkinter.Tk() call (and probably should get rid of the import as well). That way, matplotlib won't

Re: [Matplotlib-users] Matplotlib, Tk, and multithreading

2013-03-14 Thread Goyo
2013/3/14 Oliver King oliver.afr...@gmail.com: [...] I tried doing as you suggested [don't import Tk directly and change the backend to Agg] but it still crashes with the same TkAqua message. You must set the desired backend from the very begining and before importing pylab o pyplot. Goyo

Re: [Matplotlib-users] Matplotlib, Tk, and multithreading

2013-03-14 Thread Oliver King
You must set the desired backend from the very begining and before importing pylab o pyplot. That did it - I made the change in my .matplotlibrc file and it no longer crashes. Thanks! Oliver -- Everyone hates slow

[Matplotlib-users] Matplotlib, Tk, and multithreading

2013-03-13 Thread Oliver King
Hi, I have a library which uses matplotlib to produce some plots. This library is called by a thread. However, python crashes with this error when it tries to plot something: Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main thread! If I do as it says and call window