From c649d8d569eb8e6eb3e5d2c62b087716ccf7b3a3 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Mon, 13 Apr 2020 08:19:58 +0200 Subject: [PATCH] Add --log-time and --log-x flags --- scripts/plot_parametrized.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/plot_parametrized.py b/scripts/plot_parametrized.py index 82170a2..d100681 100755 --- a/scripts/plot_parametrized.py +++ b/scripts/plot_parametrized.py @@ -15,6 +15,13 @@ parser.add_argument( type=str, help="Name of the parameter / x-axis label", ) +parser.add_argument( + "--log-x", help="Use a logarithmic x (parameter) axis", action="store_true" +) +parser.add_argument( + "--log-time", help="Use a logarithmic time axis", action="store_true" +) + args = parser.parse_args() for filename in args.file: @@ -29,5 +36,13 @@ for filename in args.file: plt.xlabel(args.parameter_name) plt.ylabel("Time [s]") -plt.ylim(0, None) + +if args.log_time: + plt.yscale("log") +else: + plt.ylim(0, None) + +if args.log_x: + plt.xscale("log") + plt.show()