📜  matplotlib 增加滴答频率 - Python 代码示例

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

代码示例2
# credit ot the Stack Overflow user in the source link
# this is just an example in which you increase the number of ticks on the x-axis
# that is, the spacing between consecutive plotted ticks is reduced 

import numpy as np
import matplotlib.pyplot as plt

x = [0,5,9,10,15]
y = [0,1,2,3,4]

plt.plot(x,y)
plt.xticks(np.arange(min(x), max(x)+1, 1.0))
plt.show()