Skip to content

Commit

Permalink
prevent plt.show() triggering when show_plot=False
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Apr 12, 2024
1 parent a736f2a commit 7d108af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions centerline_width/plotDiagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def plotCenterline(river_object: centerline_width.riverCenterline = None,

plt.legend(loc="upper right")
if show_plot: plt.show()
if not show_plot: plt.close()
if save_plot_name: fig.savefig(save_plot_name)


Expand Down Expand Up @@ -391,4 +392,5 @@ def plotCenterlineWidth(river_object: centerline_width.riverCenterline = None,

plt.legend(loc="upper right")
if show_plot: plt.show()
if not show_plot: plt.close()
if save_plot_name: fig.savefig(save_plot_name)

0 comments on commit 7d108af

Please sign in to comment.