mpl-probscale:用于 matplotlib 的真实概率刻度

https://travis-ci.org/matplotlib/mpl-probscale.svg?branch=master https://coveralls.io/repos/matplotlib/mpl-probscale/badge.svg?branch=master&service=github

https://github.com/matplotlib/mpl-probscale

安装

正式版本

正式版本可通过 conda-forge 频道或 pip 获取

conda install mpl-probscale --channel=conda-forge

pip install probscale

开发版本

这是一个纯 Python 包,因此在所有平台上从源代码构建都很容易

git clone [email protected]:matplotlib/mpl-probscale.git
cd mpl-probscale
pip install -e .

快速入门

只需导入 probscale 即可在 matplotlib 图形中使用概率刻度

import matplotlib.pyplot as plt
import probscale
import seaborn
clear_bkgd = {'axes.facecolor':'none', 'figure.facecolor':'none'}
seaborn.set(style='ticks', context='notebook', rc=clear_bkgd)

fig, ax = plt.subplots(figsize=(8, 4))
ax.set_ylim(1e-2, 1e2)
ax.set_yscale('log')

ax.set_xlim(0.5, 99.5)
ax.set_xscale('prob')
seaborn.despine(fig=fig)
_images/example.png

测试

从交互式 Python 会话中运行测试最容易

import matplotlib
matplotlib.use('agg')
import probscale
probscale.test()