📜  plt.xticks - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:18.575000             🧑  作者: Mango

代码示例5
# Show x axes with intervals of X instead of default (this case default=5)
import numpy as np
import matplotlib.pyplot as plt

x = [0,5,9,10,15]
y = [0,1,2,3,4]
X = 1.0
plt.plot(x,y)
plt.xticks(np.arange(min(x), max(x)+1, X))
plt.show()