Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Real probability scales for matplotlib

License

NotificationsYou must be signed in to change notification settings

matplotlib/mpl-probscale

Repository files navigation

Real probability scales for matplotlib

CoverageLinterTests

Sphinx Docs

Installation

Official releases

Official releases are available through the conda-forge channel or pip

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

pip install probscale

Development builds

This is a pure-python package, so building from source is easy on all platforms:

git clone git@github.com:matplotlib/mpl-probscale.gitcd mpl-probscalepip install -e.

Quick start

Simply importingprobscale lets you use probability scales in your matplotlib figures:

frommatplotlibimportpyplotfromscipyimportstatsimportprobscale# nothing else neededbeta=stats.beta(a=3,b=4)weibull=stats.weibull_min(c=5)scales= [    {"scale": {"value":"linear"},"label":"Linear (built-in)"},    {"scale": {"value":"log","base":10},"label":"Log. Base 10 (built-in)"},    {"scale": {"value":"log","base":2},"label":"Log. Base 2 (built-in)"},    {"scale": {"value":"logit"},"label":"Logit (built-in)"},    {"scale": {"value":"prob"},"label":"Standard Normal Probability (this package)"},    {"scale": {"value":"prob","dist":weibull},"label":"Weibull probability scale, c=5 (this package)",    },    {"scale": {"value":"prob","dist":beta},"label":"Beta probability scale, α=3 & β=4 (this package)",    },]N=len(scales)fig,axes=pyplot.subplots(nrows=N,figsize=(9,N-1),constrained_layout=True)forscale,axinzip(scales,axes.flat):ax.set_xscale(**scale["scale"])ax.text(0.0,0.1,scale["label"]+" →",transform=ax.transAxes)ax.set_xlim(left=0.5,right=99.5)ax.set_yticks([])ax.spines.left.set_visible(False)ax.spines.right.set_visible(False)ax.spines.top.set_visible(False)outpath=Path(__file__).parent.joinpath("../img/example.png").resolve()fig.savefig(outpath,dpi=300)

Alt text

Testing

Testing is generally done viapytest.

python -m pytest --mpl --doctest-glob="probscale/*.py"

About

Real probability scales for matplotlib

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors7

Languages


[8]ページ先頭

©2009-2025 Movatter.jp