python - Matplotlib 不显示所有带有条形图的刻度/标签?
问题描述
绘制具有许多点的线时,matplotlib 会自动隐藏一些 x 轴刻度/标签,以确保所有标签都适合。
如果我想绘制一个有很多点的条形聊天,是否有办法让 matplotlib 像使用线图一样考虑 x 轴?现在它正试图挤进所有的标签。
解决方案
我建议指定 xtick 标签列表:
plt.xticks([80,150,300]) ### In this case these are numbers, change them to your values
推荐阅读
- python - 如何使用 Pandas 将一列中的值转换为列?
- html - Django - 跟随按钮功能不起作用
- python-3.x - Python re:获取引号或双引号
- azure - 本地化不适用于生产 - .NET core 3.1
- javascript - 如何设置状态以响应数组中某个索引处的内容
- javascript - 随机的 Javascript 和 typescript 文件内容更改为奇怪的字符,导致编译失败
- javascript - 如何在本机反应中使用 json 元素
- python - 调试在 VS Studio Code Django 中不起作用
- reactjs - Nextjs - 如果在客户端运行,则注入 ContextProvider
- c++ - 出现错误:致命错误:curl/curl.h:没有这样的文件或目录#include