matplotlib - 没有科学的y轴matplotlib
问题描述
我正在使用此代码获得科学记数法 y 轴标签。我只想要简单的数字。我怎么做?
import matplotlib.pyplot as plt
import matplotlib
from IPython.core.display import display, HTML
#display(HTML("<style>.container { width:70% !important; }</style>"))
display(HTML("<style>.container { width:100% !important; }</style>"))
%matplotlib inline
from matplotlib.ticker import ScalarFormatter, FormatStrFormatter
plt.rcParams['figure.figsize'] = [20, 10]
fig, ax = plt.subplots()
ax.semilogy(df.close)
ax.grid()
ax.yaxis.set_major_formatter(FormatStrFormatter('%.0f'))
plt.show()
解决方案
推荐阅读
- django - Django如何使ManyToMany字段的每个成员都是唯一的?
- axapta - AOT 查询关系或案例
- amazon-web-services - Alexa 向 AWS Lambda 发送了多个请求
- php - 删除 mysqli_connect() (HY000/2002) 警告并通过 JSON 对象发送错误
- spring-boot - 处理 OneToMany 关系时无法保存父 ID
- jsf - Weblogic 12c R2 (12.2.1.3) 错误 myfaces timeout java.sun.com with web.xml 2.3 tag
- r - 如何从R输出比较Cox回归中不同水平的风险比?
- mysql - 如何使用 Spring MVC 框架从 MySQL 下载 BLOB
- xml - Golang 自定义解组 XML
- sql-server - 实体框架应根据少数列的唯一值集检查重复记录,然后添加新记录