Ai
2 Star 0 Fork 0

mirrors_lepy/corner.py

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
demo.py 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Dan F-M 提交于 2016-05-24 23:49 +08:00 . changing package structure
#!/usr/bin/env python
import numpy as np
from matplotlib import rcParams
import corner
rcParams["font.size"] = 16
rcParams["font.family"] = "sans-serif"
rcParams["font.sans-serif"] = ["Computer Modern Sans"]
rcParams["text.usetex"] = True
rcParams["text.latex.preamble"] = r"\usepackage{cmbright}"
np.random.seed(42)
# Set up the parameters of the problem.
ndim, nsamples = 3, 50000
# Generate some fake data.
data1 = np.random.randn(ndim * 4 * nsamples / 5).reshape([4 * nsamples / 5,
ndim])
data2 = (4 * np.random.rand(ndim)[None, :] +
np.random.randn(ndim * nsamples / 5).reshape([nsamples / 5, ndim]))
data = np.vstack([data1, data2])
# Plot it.
figure = corner.corner(data, labels=[r"$x$", r"$y$", r"$\log \alpha$",
r"$\Gamma \, [\mathrm{parsec}]$"],
quantiles=[0.16, 0.5, 0.84],
show_titles=True, title_kwargs={"fontsize": 12})
figure.gca().annotate("a demo corner plot",
xy=(1.0, 1.0), xycoords="figure fraction",
xytext=(-20, -10), textcoords="offset points",
ha="right", va="top")
figure.savefig("demo.png", dpi=300)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_lepy/corner.py.git
git@gitee.com:mirrors_lepy/corner.py.git
mirrors_lepy
corner.py
corner.py
master

搜索帮助