Skip to content

Commit

Permalink
feat: add "skip_plt_show" arg to plotter (#136)
Browse files Browse the repository at this point in the history
* Added "skip_plt_show" arg to plotter

Signed-off-by: Shintaro Sakoda <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Shintaro Sakoda <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
SakodaShintaro and pre-commit-ci[bot] authored Oct 22, 2024
1 parent 8bb8b1e commit 7eb78cf
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, args, ylabel, output_suffix):
self.ymax = args.ymax
self.number_of_plot = args.number_of_plot
self.save_result = args.save_result
self.skip_plt_show = args.skip_plt_show
self.ylabel = ylabel
self.output_suffix = output_suffix

Expand Down Expand Up @@ -174,7 +175,8 @@ def run(self):
# save figure of plot
plt.savefig(f"./result/{output_name}-{timestamp}.png")

plt.show()
if not self.skip_plt_show:
plt.show()


def create_common_argment(ymax=None):
Expand All @@ -193,6 +195,13 @@ def create_common_argment(ymax=None):
parser.add_argument(
"-s", "--save-result", default=False, action="store_true", help="whether to save result"
)
parser.add_argument(
"-p",
"--skip_plt_show",
default=False,
action="store_true",
help="whether to skip plt.show()",
)

args = parser.parse_args()

Expand Down

0 comments on commit 7eb78cf

Please sign in to comment.