aroberge / easygui_qt

Inspired by easygui, designed for PyQt
BSD 3-Clause "New" or "Revised" License
59 stars 18 forks source link

A simple question with matplotlib plot window #22

Closed zhangqi-chen closed 7 years ago

zhangqi-chen commented 9 years ago

Hey, all, I have a question with matplotlib. When I run a simple code like this:

import matplotlib.pyplot as plt import easygui_qt as easy plt.ion() plt.plot([1,2,3]) easy.get_int()

after I enter the integer and close the qt window, the plot window just crashes and cannot be closed. Any ideas?

This won't happen when I use easygui. So tkinter does not have such issue.

aroberge commented 9 years ago

Easygui_qt starts a QtApplication for each individual widget and closes it. My understanding of the Qt framework is that it allows only one QtApplication running at a time; closing it might very well be the cause of the plot window crash.

zhangqi-chen commented 9 years ago

Thanks, so any ideas to solve this? Or I may turn to easygui probably.

aroberge commented 9 years ago

If easygui works for you, then I'd suggest to use it instead.

triccare commented 9 years ago

Which python interpreter are you using? If ipython, look up forcing the use of pyqt with matplotlib in ipython. there may simply be a conflict of gui backends.

zhangqi-chen commented 9 years ago

I use spyder. I tried Ipython console in spyder and only if I use qt as gui backends, the window would crash. So I guess I just use inline or wx. Thanks a lot!