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

add grid support for "multibar"

parent 1c8bdcd3
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,7 @@ if __name__ == "__main__":
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")
multi_bar_parser.add_argument("--grid", action="store_true")
common_options = [
{
......@@ -216,6 +217,7 @@ if __name__ == "__main__":
plot_layout=plot_layout,
use_tex=args.use_tex,
log_scale=args.log_scale,
grid=args.grid,
style=json.loads(args.style),
)
......
......@@ -84,6 +84,7 @@ def multi_bar(
plot_layout: str = "constrained",
use_tex: bool = False,
log_scale: bool = False,
grid: bool = False,
style: dict = {},
) -> matplotlib.figure.Figure:
if labels_locations is None:
......@@ -108,6 +109,8 @@ def multi_bar(
ax.set_title(title)
if log_scale:
ax.set_yscale('log')
if grid:
ax.yaxis.grid(True, which="major")
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