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

Benjamin Root ben.v.root at gmail.com
Mon May 16 14:46:20 EDT 2016


In general, yes, you should avoid using pyplot when embedding. However,
that rule actually only needs to be strictly followed when you are
embedding the matplotlib's canvas into your own instantiated Window object.
If you are embedding GUI elements into a matplotlib figure window, you
actually can still utilize pyplot (but very carefully).

I suggest reading up my book:
http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/

Cheers!
Ben Root


On Tue, Apr 26, 2016 at 5:28 PM, Eric <eric.shain at gmail.com> wrote:

> I've read that when writing a GUI application to avoid using pyplot. I
> experienced this when I wrote a python script that called the tkinter file
> dialog and then processed and plotted data. It would run when launched in
> Ipython but would crash when run in the terminal. It ran in terminal when I
> eliminated the file dialog and the file dialog code ran without the
> plotting. I rewrote the script using pyqt4, and avoided using pyplot using
> matplotlib figure instead. First question is is it true that I should avoid
> any use of pyplot in a gui app? Second is that I find it hard to do things
> in matplotlib that are easy in pyplot like drawing horizontal or vertical
> lines and such. Is there documentation and code examples using the
> matplotlib without pyplot?
>
> Thanks, Eric
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Use-of-Pyplot-in-a-GUI-script-tp47030.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160516/dcbd82cf/attachment.html>


More information about the Matplotlib-users mailing list