角图添加另一个点
Corner plot add another point
我正在使用以下 MWE:
def contour(fit, mu_des,dt_des):
la = fit.extract(permuted=True)
mu_pos = np.vstack((la['mu'])).T
dt_pos = np.vstack((la['dt'])).T
postsamples = np.vstack((mu_pos, dt_pos)).T
fig = corner.corner(postsamples, labels=[r"$\mu$", r"$dt$"],color='g', smooth=1,
levels=(0.68,0.95),plot_density=0, fill_contours=1, plot_datapoints=1,
truths=list([mu_des,dt_des]))
return fig
现在我也想在剧情中显示一个自定义点。这个问题有点类似于,但我无法理解答案。请帮忙
好的,我在 link given below. 之后得到了答案
可以将函数更改为
def contour(fit):
la = fit.extract(permuted=True)
mu_pos = np.vstack((la['mu'])).T
dt_pos = np.vstack((la['dt'])).T
#print(mu_pos.shape)
#P_pos=np.vstack((la['P'])).T
postsamples = np.vstack((mu_pos, dt_pos)).T
#print(postsamples.shape)
fig = corner.corner(postsamples, labels=[r"$\mu$", r"$dt$"],color='g', smooth=1,
levels=(0.68,0.95),plot_density=0, fill_contours=1, plot_datapoints=1,
truths=list([mu_des,dt_des]))
axes = np.array(fig.axes).reshape((2, 2)); print(axes)
ax = axes[1, 0];
ax.plot(value1, value2, "sg")
return fig
我正在使用以下 MWE:
def contour(fit, mu_des,dt_des):
la = fit.extract(permuted=True)
mu_pos = np.vstack((la['mu'])).T
dt_pos = np.vstack((la['dt'])).T
postsamples = np.vstack((mu_pos, dt_pos)).T
fig = corner.corner(postsamples, labels=[r"$\mu$", r"$dt$"],color='g', smooth=1,
levels=(0.68,0.95),plot_density=0, fill_contours=1, plot_datapoints=1,
truths=list([mu_des,dt_des]))
return fig
现在我也想在剧情中显示一个自定义点。这个问题有点类似于
好的,我在 link given below. 之后得到了答案 可以将函数更改为
def contour(fit):
la = fit.extract(permuted=True)
mu_pos = np.vstack((la['mu'])).T
dt_pos = np.vstack((la['dt'])).T
#print(mu_pos.shape)
#P_pos=np.vstack((la['P'])).T
postsamples = np.vstack((mu_pos, dt_pos)).T
#print(postsamples.shape)
fig = corner.corner(postsamples, labels=[r"$\mu$", r"$dt$"],color='g', smooth=1,
levels=(0.68,0.95),plot_density=0, fill_contours=1, plot_datapoints=1,
truths=list([mu_des,dt_des]))
axes = np.array(fig.axes).reshape((2, 2)); print(axes)
ax = axes[1, 0];
ax.plot(value1, value2, "sg")
return fig