Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Interactive Applications using Matplotlib

You're reading from  Interactive Applications using Matplotlib

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781783988846
Pages 174 pages
Edition 1st Edition
Languages

Matplotlib in your app


We have peered behind the canvas and have gained an immense understanding of how backends in Matplotlib operate. For four of the major backends, we have even seen how to augment our application with GUI widgets, learning some of the subtle differences in the backends.

But, what if you already have a GUI application written in Python, and the Matplotlib portion is the new feature to add? This is called embedding. The basic idea is that the canvas is added to your application as a widget. The tricky part is that you cannot let pyplot create the Figure instance. The pyplot module assumes that it will be responsible for triggering and terminating the application mainloop. It also automatically attaches the figure managers to the canvases. This can conflict with normal application operations. Therefore, when embedding, it is best to completely bypass pyplot.

Like in the previous section, we will examine how to embed the Matplotlib canvas into a GUI Python application in four...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}