简体   繁体   English

Matplotlib x标签被压在一起

[英]Matplotlib x-labels squished together

I've set my matplotlib graph's x-label format to DateFormatter('%Y-%m'). 我已经将matplotlib图的x标签格式设置为DateFormatter('%Y-%m')。 My problem is that I have so many dates that they're all squished together into what's starting to look like a black rectangle under my graph. 我的问题是,我有太多的日期,所有日期都挤在一起,变成了我的图表下开始看起来像黑色矩形的形状。 Can I set it to not display every label? 我可以设置为不显示所有标签吗? For example if it only displayed ever fifth date people will still be able to visualize what's in-between. 例如,如果仅显示第五次约会,人们仍然可以看到中间的内容。 If there are other ways to fix this I'd love to know them also. 如果还有其他方法可以解决此问题,我也想知道。

Thanks 谢谢

You can look at this post matplotlib: how to prevent x-axis labels from overlapping each other 您可以查看这篇matplotlib文章:如何防止x轴标签彼此重叠

But the short answer is to adjust the frequency of the tic marks. 但是简单的答案是调整抽签的频率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM