[Matplotlib-users] Use of Pyplot in a GUI script

Jason Swails jason.swails at gmail.com
Thu May 19 08:12:58 EDT 2016


FWIW, I wrote a Tkinter-based GUI program several years ago where I
embedded a matplotlib canvas in my own window, and I used pyplot just
fine.  I put it up on GitHub yesterday which you can use as an example (
https://github.com/swails/mdout_analyzer) in case it helps.

For me, also, the key ingredient was setting the Tk backend to avoid
competing mainloops for the different GUI toolkits.  The reason I embedded
the matplotlib graphs in my own window is so that I could destroy those
windows when the main control window was closed (if you rely on matplotlib
to create the windows for you, you can't control that window as easily from
other parts of your application).

All the best,
Jason

On Wed, May 18, 2016 at 1:05 PM, Eric's Gmail <eric.shain at gmail.com> wrote:

> Awesome!
>
> This works so long as I callout before the importing of pyplot.
>
> Eric
>
> On May 18, 2016, at 11:13 AM, Eric Firing <efiring at hawaii.edu> wrote:
>
> matplotlib.use('tkagg')
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>


-- 
Jason M. Swails
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160519/027fefdd/attachment-0001.html>


More information about the Matplotlib-users mailing list