Python Plotting and displaying multiple objects in same GUI window

plot, python, tkinter, user-interface

Solution

Matplotlib is the de-facto way to plot data with Python. It's really wonderful. It can also be embedded in Tk.

Problem

I have a 2 part question: what is the best method for plotting data in Python? I only need to plot data in 2d. I have a canvas GUI that I built using Tkinter's canvas function. It draws an 8x8 grid of rectangles and also has some code to allow you to scroll the window. (I've attached a picture). Is it possible to include a plot in the same window as this canvas object? I need to be able to display plotted data and hopefully add buttons to my GUI that will allow me to update the plot during the run of the GUI. Thanks in advance!

Original source