Skip to content
Snippets Groups Projects
Verified Commit 1c8bdcd3 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

add log scale to "multibar"

parent adf97c54
Branches
No related tags found
No related merge requests found
......@@ -132,6 +132,7 @@ if __name__ == "__main__":
multi_bar_parser.add_argument("data", type=str, nargs="?", help=f"the actual data to show in a multibar plot\n\n{multi_bar.HELP}")
multi_bar_parser.add_argument("--label", "-l", type=str, help="the measurement label of the multibar plot")
multi_bar_parser.add_argument("--style", type=str, default="{}", help="specification for the style of the bar plots, in JSON")
multi_bar_parser.add_argument("--log-scale", action="store_true")
common_options = [
{
......@@ -214,6 +215,7 @@ if __name__ == "__main__":
args.label,
plot_layout=plot_layout,
use_tex=args.use_tex,
log_scale=args.log_scale,
style=json.loads(args.style),
)
......
......@@ -83,6 +83,7 @@ def multi_bar(
legend_loc: str = "upper left",
plot_layout: str = "constrained",
use_tex: bool = False,
log_scale: bool = False,
style: dict = {},
) -> matplotlib.figure.Figure:
if labels_locations is None:
......@@ -105,6 +106,8 @@ def multi_bar(
ax.set_ylabel(y_label)
ax.set_title(title)
if log_scale:
ax.set_yscale('log')
ax.set_xticks(labels_locations + width, groups)
ax.legend(loc=legend_loc, ncols=nb_legend_cols)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment