擅长:python、mysql、java
<p>您可以使用如下方法将记号设置为<code>np.arange</code>的某个输出:</p>
<pre><code>def aranger(cols, n_ticks):
return np.arange(cols.min(), cols.max(), (cols.max()-cols.min())/n_ticks)
# Plotting Hot Springs housing value over time
fig=plt.figure(figsize=(20, 8), dpi= 80, facecolor='w', edgecolor='k')
ax=plt.axes
index = aranger(syrHST[['71913','71901']], 10)
plt.plot(syrHST['71913'],color='blue')
plt.plot(syrHST['71901'],color='red')
plt.xticks(index, rotation='vertical', fontsize=20)
plt.ylabel('Average Housing Value', fontsize=20)
plt.gca().legend(('71913','71901'), fontsize=20, loc='upper left')
fig.suptitle('Hot Springs', fontsize=40)
plt.show()
</code></pre>
<p>没有虚拟数据我无法测试,但这是我认为你可以用来解决这个问题的一般模式。你知道吗</p>