import matplotlib.pyplot as plt fig = plt.figure() ax = fig.subplots() ax.plot([1, 2, 3, 4], [0, 0.5, 1, 0.2])