jaleman
jaleman

Reputation: 63

Examples for embedding matplotlib graphs in Tkinter

I'm trying to embed a matplotlib graph in tkinter. All the resources I have come across like this one or this one make use of the FigureCanvasTk.show function and the NavigationToolbar2TkAgg class which have been deprecated.

What do I need to use instead?

Upvotes: 0

Views: 1085

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339250

The most up to date examples are to be found in the matplotlib devdocs, http://matplotlib.org/devdocs/.

This is the devdoc example for TK.

To answer the real question in between the lines,

  • FigureCanvasTk.show() needs to be replaced by FigureCanvasTk.draw()
  • NavigationToolbar2TkAgg needs to be replaced by NavigationToolbar2Tk

Upvotes: 2

Related Questions