Python 为matplotlib图形创建空间
我的任务是根据每个月的总降雨量绘制一个图表。我编写了代码和图表,但我在X轴上遇到了一个问题,它没有足够的空间让它可读。 我以为给x轴一个更大的值会有帮助,但我想我错了 代码: 图表:Python 为matplotlib图形创建空间,python,matplotlib,graph,Python,Matplotlib,Graph,我的任务是根据每个月的总降雨量绘制一个图表。我编写了代码和图表,但我在X轴上遇到了一个问题,它没有足够的空间让它可读。 我以为给x轴一个更大的值会有帮助,但我想我错了 代码: 图表: 尝试使用rotation=90 plt.xticks([100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200], ['January ','Februrary','March','April','May','June','J
尝试使用
rotation=90
plt.xticks([100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200],
['January ','Februrary','March','April','May','June','July','August','September',
'October',"November", "December"], rotation=90)
你有我最大的魅力,我甚至没想到。非常感谢你的邀请help@TenebrisMortem:如果我的答案对你有帮助,你应该读到抱歉我之前尝试过对我的问题进行投票,但网站说我需要一个特定的级别感谢提供的信息^ummm quick queston如何对作为评论的答案进行投票?我目前正在投票,并接受在选举中帮助我的答案past@TenebrisMortem当前位置要更新评论,我认为你需要更多的声誉点数。
Enter the Rainfall each month
Month # 1 : 1
Month # 2 : 2
Month # 3 : 3
Month # 4 : 4
Month # 5 : 5
Month # 6 : 6
Month # 7 : 7
Month # 8 : 8
Month # 9 : 10
Month # 10 : 12
Month # 11 : 13
Month # 12 : 14
total Amount= 85
Average Average Amount 7.08
The months with the highest value are :
[12]
The months with the Lowest value are :
[1]
Process finished with exit code 0
plt.xticks([100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200],
['January ','Februrary','March','April','May','June','July','August','September',
'October',"November", "December"], rotation=90)