I am trying to customize my x-axis with minor ticks but I want to bolden or lengthen the middle minor tick. So basically I want a major, middle, and minor tick for my subplot. I tried using tick_params but that overwrites the previous modifications to the ticks. Is there another way to achieve this?
The end result should have 4 minor ticks and 2 semi-minor ticks between the labeled numbers.
Bonus points if there is a way to label the semi-minor ticks.
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator)
t = np.arange(0.0, 100.0, 0.1)
s = np.sin(0.1 * np.pi * t) * np.exp(-t * 0.01)
fig, ax = plt.subplots()
ax.plot(t, s)
#Try to set 4 minor ticks
ax.xaxis.set_minor_locator(AutoMinorLocator(4))
ax.tick_params(which='minor', length=2, color='k')
#Set 2 minor ticks that are larger
ax.xaxis.set_minor_locator(AutoMinorLocator(2))
ax.tick_params(which='minor', length=6, color='k')
#Make major ticks even larger
ax.tick_params(which='major', length=12, color='k')
plt.show()


