import numpy as np
import pandas as pd
import matplotlib
from matplotlib import pyplot as plt, ticker
from matplotlib.ticker import ScalarFormatter
data = pd.read_excel("直方图数据.xlsx")
bins = 10 ** np.arange(-3, 3, 0.05)
f, ax = plt.subplots(1, 1)
plt.hist(data[0], bins=bins, edgecolor="black", range=(0, 100), rwidth=1, color="#CCCCCC")
plt.xscale("log")
plt.xlim((0.001, 1000))
plt.xlabel("$\mathregular{R}$(mm $\mathregular{h^-}$$\mathregular{^1}$)")
plt.ylabel("Differential water column (mm/(mm $\mathregular{h^-}$$\mathregular{^1}$)")
plt.rcParams['xtick.direction'] = "in"
plt.rcParams['ytick.direction'] = "in"
plt.text(0.0015, 67, "500m")
ax.xaxis.set_major_formatter(ScalarFormatter())
ax.xaxis.set_major_formatter(ticker.FuncFormatter(lambda y, _: '{:g}'.format(y)))
plt.savefig("hist.png")
plt.show()
没有合适的资源?快使用搜索试试~ 我知道了~
Python matplotlib 绘制直方图 Differential water column带有注释、X次方的标注方法
共4个文件
xlsx:1个
py:1个
png:1个
5 下载量 51 浏览量
2023-01-22
10:04:05
上传
评论 1
收藏 43KB RAR 举报
温馨提示
Python matplotlib 绘制直方图 Differential water column带有注释、X次方的标注方法 jupyter notebook numpy pandas 数据分析 数据挖掘
资源推荐
资源详情
资源评论
收起资源包目录
2280.rar (4个子文件)
直方图数据.xlsx 21KB
hist.png 18KB
h180.py 846B
h180.ipynb 14KB
共 4 条
- 1
资源评论
HinomotoOniko
- 粉丝: 1840
- 资源: 139
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功