Skip to content Skip to sidebar Skip to footer

How Do I Subclass Matplotlib's Figure Class?

I'm trying to add some custom behaviors and properties to my figures, but I'm having trouble deciding on an effective (and Pythonic) approach. My first impulse is to simply subcla

Solution 1:

subplots takes additional keyword arguments that are passed directly to figures(), one of which is the class used to create the figures.

class MyFigure(Figure):
    pass

fig, ax = matplotlib.pyplot.subplots(FigureClass=MyFigure)

Post a Comment for "How Do I Subclass Matplotlib's Figure Class?"