Skip to content

Commit

Permalink
improves aesthetics and docs of marginalplot
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermoaguilar committed Sep 20, 2024
1 parent d762a6f commit 11305b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions psignifit/psigniplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def plot_marginal(result: Result,
Args:
result: should be a result struct from the main psignifit routine
dim: The parameter to plot. 1=threshold, 2=width, 3=lambda, 4=gamma, 5=sigma
dim: The parameter to plot. 'threshold', 'width', 'lambda', 'gamma', 'eta'
"""
if ax is None:
ax = plt.gca()
Expand All @@ -188,14 +188,15 @@ def plot_marginal(result: Result,
ax.fill_between(ci_x, np.zeros_like(ci_x), np.interp(ci_x, x, marginal), color=line_color, alpha=0.5)

param_value = result.parameter_estimate[parameter]
ax.plot([param_value] * 2, [0, np.interp(param_value, x, marginal)], color=line_color)
ax.plot([param_value] * 2, [0, np.interp(param_value, x, marginal)], color='#000000')

if plot_prior:
ax.plot(x, result.prior_values[parameter], ls='--', color=prior_color, clip_on=False)

ax.plot(x, marginal, lw=line_width, c=line_color, clip_on=False)
ax.set_xlabel(x_label)
ax.set_ylabel(y_label)
ax.spines[['top', 'right']].set_visible(False)

return ax

Expand Down

0 comments on commit 11305b5

Please sign in to comment.