ax の xtics と ytics を使って表示する。
詳細は次のドキュメントを参照。
例
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
x = np.linspace(-5, 5, num=100, endpoint=True)
y = np.sin(x)
fig, ax = plt.subplots()
ax.plot(x,y)
ax.set_xticks(np.arange(-3,3,1))
ax.set_yticks(np.arange(-1,1.1,0.5))
plt.show()
結果
