Force background of matplotlib figure to be transparent
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as