So far, we have seen Matplotlib automatically placing ticks and ticklabels based on input data. In this recipe, we will learn how to customize these default settings on both the x and y axes for categorical and numerical variables.
Customizing ticks and ticklabels
Getting ready
Let's import the required libraries:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator)
from matplotlib.ticker import FuncFormatter
How to do it...
The following code blocks plot...