Skip to content

Commit b2d34a0

Browse files
authored
Removes wait_for_close (#150)
1 parent 89e5fdd commit b2d34a0

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

RATapi/utils/plotting.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,7 @@ def plot_corner(
473473
fig.tight_layout()
474474
if return_fig:
475475
return fig
476-
fig.show()
477-
if block:
478-
fig.wait_for_close()
476+
plt.show(block=block)
479477

480478

481479
@assert_bayesian("Histogram")
@@ -585,9 +583,7 @@ def plot_one_hist(
585583
if fig is not None:
586584
if return_fig:
587585
return fig
588-
fig.show()
589-
if block:
590-
fig.wait_for_close()
586+
plt.show(block=block)
591587

592588

593589
@assert_bayesian("Contour")
@@ -662,9 +658,7 @@ def plot_contour(
662658
if fig is not None:
663659
if return_fig:
664660
return fig
665-
fig.show()
666-
if block:
667-
fig.wait_for_close()
661+
plt.show(block=block)
668662

669663

670664
def panel_plot_helper(plot_func: Callable, indices: list[int]) -> matplotlib.figure.Figure:
@@ -804,9 +798,7 @@ def validate_dens_type(dens_type: Union[str, None], param: str):
804798
)
805799
if return_fig:
806800
return fig
807-
fig.show()
808-
if block:
809-
fig.wait_for_close()
801+
plt.show(block=block)
810802

811803

812804
@assert_bayesian("Chain")
@@ -858,9 +850,7 @@ def plot_one_chain(axes: Axes, i: int):
858850
fig = panel_plot_helper(plot_one_chain, params)
859851
if return_fig:
860852
return fig
861-
fig.show()
862-
if block:
863-
fig.wait_for_close()
853+
plt.show(block=block)
864854

865855

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

0 commit comments

Comments
 (0)