Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include truth values on Fisher matrix plots #149

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cosmosis/postprocessing/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,11 @@ def plot_1d(self, name, mu, sigma):
sigma2 = sigma**2
x = np.linspace(xmin, xmax, 200)
p = np.exp(-0.5 * (x-mu)**2 / sigma2)# / np.sqrt(2*np.pi*sigma2)
figure,filename = self.figure(name)
figure, filename = self.figure(name)
pylab.figure(figure.number)
if not hasattr(figure, "cosmosis_done_truth"):
self.plot_truth_1d(name)
figure.cosmosis_done_truth = True
pylab.plot(x, p, label=self.source.label)
pylab.xlabel(self.latex(name))
pylab.ylabel("Posterior")
Expand Down Expand Up @@ -1116,9 +1119,13 @@ def plot_2d(self, name1, i, name2, j):
s22 = covmat[1,1]**0.5

#Open the figure (new or existing) for this pair
figure,filename = self.figure("2D", name1, name2)
figure, filename = self.figure("2D", name1, name2)
pylab.figure(figure.number)

if not hasattr(figure, "cosmosis_done_truth"):
self.plot_truth_2d(name1, name2)
figure.cosmosis_done_truth = True

#Plot the 1 sigma and 2 sigma ellipses
self.plot_cov_ellipse(covmat, pos, nstd=1, facecolor=None,
edgecolor=self.line_color(), linewidth=2, fill=False, label=self.source.label)
Expand Down Expand Up @@ -1363,4 +1370,4 @@ def run(self):
pylab.xlabel(self.latex(col1))
pylab.ylabel(self.latex(col2))
filenames.append(filename)
return filenames
return filenames
Loading