data-visualization - autofmt_xdate() not drawing the label diagonally
问题描述
I was using jupyterlab to create a graph for highest daily temperature. This is the part of my code that does the graphing. I tried to use 'autofmt_xdate()' attribute to draw the date labels diagonally, but it doesn't work. The date labels were still drawn horizontally, overlapping each other.
from matplotlib import pyplot as plt
fig=plt.figure(dpi=128,figsize=(10,6))
plt.show()
plt.plot(dates,highs,c='Red')
plt.title('highest temperature,July 2018')
plt.xlabel('date',fontsize=16)
fig.autofmt_xdate()
plt.ylabel('temperature C',fontsize=16)
plt.tick_params(axis='both',which='major',labelsize=16)
plt.show()
解决方案
推荐阅读
- javascript - ECharts:为具有多个系列的每个项目显示标签
- c++ - 程序使用“Windows 本地调试器”运行,但在以发布或调试模式构建后运行 .exe 文件时不运行
- java - 片段之间的导航问题
- amazon-s3 - COPY INTO 雪花表未加载数据 - 无错误
- angular - Firestore 添加集合
- java - 尝试使用方法创建驾驶执照考试程序
- python - 网页抓取 Google 时转到下一页
- php - 查看 laravel auth/user 对象中是否存在某些东西
- python - 使用硒(Python)接收后打印和存储元素
- git - 通过单个 SSH 会话进行多个远程 git 操作?