Skip to content
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
20 changes: 5 additions & 15 deletions RATapi/utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,7 @@ def plot_corner(
fig.tight_layout()
if return_fig:
return fig
fig.show()
if block:
fig.wait_for_close()
plt.show(block=block)


@assert_bayesian("Histogram")
Expand Down Expand Up @@ -585,9 +583,7 @@ def plot_one_hist(
if fig is not None:
if return_fig:
return fig
fig.show()
if block:
fig.wait_for_close()
plt.show(block=block)


@assert_bayesian("Contour")
Expand Down Expand Up @@ -662,9 +658,7 @@ def plot_contour(
if fig is not None:
if return_fig:
return fig
fig.show()
if block:
fig.wait_for_close()
plt.show(block=block)


def panel_plot_helper(plot_func: Callable, indices: list[int]) -> matplotlib.figure.Figure:
Expand Down Expand Up @@ -804,9 +798,7 @@ def validate_dens_type(dens_type: Union[str, None], param: str):
)
if return_fig:
return fig
fig.show()
if block:
fig.wait_for_close()
plt.show(block=block)


@assert_bayesian("Chain")
Expand Down Expand Up @@ -858,9 +850,7 @@ def plot_one_chain(axes: Axes, i: int):
fig = panel_plot_helper(plot_one_chain, params)
if return_fig:
return fig
fig.show()
if block:
fig.wait_for_close()
plt.show(block=block)


def plot_bayes(project: RATapi.Project, results: RATapi.outputs.BayesResults):
Expand Down