![](/img/trans.png)
[英]How do I change the range of the x-axis with datetimes in matplotlib?
[英]How do I change the x-axis to display 'State' on matplotlib inline
如何獲取狀態名稱而不是數字顯示在x軸上,以及如何以不同的顏色顯示圖表。 國家獲勝的幅度:
您可以使用xticks
功能更改x軸標簽。 您的情況如下所示:
plt.xticks(locs=list(range(37)), labels=[list of state names goes here])
文檔在這里 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.