Example 2: Plotting a Line Graph on a Figure with Axespython import matplotlib.pyplot as plt fig = plt.figure() # Creating a figure object ax = fig.gca() # Returns the current axes instance x = [1, 2, 3, 4, 5] y = [1, 4, 9, 16, 25] ax.plot(x, y) # Plotting the line graph on the axes plt.show() # Displaying the figure ``` In conclusion, the matplotlib package library provides the Figure class and the gca() method for creating and working with plots in Python.