I have an example plot like this:
import matplotlib.pyplot as plt
import numpy as np
x1 = np.linspace(0.0, 5.0, 100)
y1 = np.cos(2 * np.pi * x1) * np.exp(-x1)
fig, ax = plt.subplots(figsize=(5, 3))
fig.subplots_adjust(bottom=0.15, left=0.2)
ax.plot(x1, y1)
ax.set_xlabel('x')
ax.set_ylabel('y')
plt.show()
What I want to do is make the tick labels, in best case conditionally, bold. For example, to print the tick labels 0.0 and 0.6 on the y-axis bold, the other ones medium.
I know I can change the font weight of the axis labels using the fontweight
argument, like:
ax.set_xlabel('x', fontweight='bold')
But I can't find anything similar for the tick labels. Could anyone help me?