I am generating some graphics in a desktop application made with Tkinter. The problem I have is that it generates very simple graphics, with a white background, and I am finding it hard to find information on the Internet about how I can play with the background color, the font of the title, add some description if possible. Let's see if anyone can help me change the background color, even if it is. Greetings, and thank you.
import tkinter as tk
from tkinter import ttk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import numpy as np
import matplotlib.pyplot as plt
class Application(ttk.Frame):
def __init__(self, main_window):
super().__init__(main_window)
main_window.geometry("600x600")
plt.figure('3') # Crea una ventana titulada '3'
self.fig, self.ax = plt.subplots()
self.ax.plot(np.random.randn(150), np.random.randn(150), 'o')
self.ax.set_title('Ejemplo grafico de puntos')
self.canvas = FigureCanvasTkAgg(self.fig, master=main_window)
self.canvas.draw()
self.canvas.get_tk_widget().pack()
if __name__ == "__main__":
main_window = tk.Tk()
app = Application(main_window)
app.mainloop()