Let's import the required libraries:
import numpy as npimport matplotlib.pyplot as pltfrom matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)from matplotlib.ticker import FuncFormatter