While plot is the easiest way to create a Matplotlib chart, using Figure in combination with Canvas creates a more custom-made graph, which looks much better and also enables us to add buttons and other widgets to it:
Matplotlib_labels.py
from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import tkinter as tk #-------------------------------------------------------------- fig = Figure(figsize=(12, 8), facecolor='white') #-------------------------------------------------------------- # axis = fig.add_subplot(111) # 1 row, 1 column, only graph axis = fig.add_subplot(211) # 2 rows, 1 column, Top graph #-------------------------------------------------------------- xValues = [1,2,3,4] ...