9951 explained code solutions for 126 technologies

python-matplotlibHow to change ticks to display inside the axes

In order to change axis labels frequency, we can use nbins option of locator_params to set the amount of ticks we want:

import matplotlib.pyplot as plt

plt.tick_params(axis='x', direction='in')
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities


plot specified data


set axis tick labels params


we want to update configuration for x axis only


display ticks inside the axis


render chart in a separate window