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

add --square-grid to plot

parent cb01950a
Branches
No related tags found
No related merge requests found
......@@ -123,6 +123,7 @@ if __name__ == "__main__":
plot_parser.add_argument("--y-ticks", type=float, nargs='*', help="the ticks for the Y axis")
plot_parser.add_argument("--y-tick-labels", type=str, nargs='*', help="the tick labels for the Y axis, should be the same length as `--y-ticks`")
plot_parser.add_argument("--font", type=str, default="{}", help="the font parameters")
plot_parser.add_argument("--square-grid", action="store_true")
multi_bar_parser = subparsers.add_parser(
"multi-bar",
......@@ -205,6 +206,7 @@ if __name__ == "__main__":
y_tick_labels=args.y_tick_labels,
font=json.loads(args.font),
use_tex=args.use_tex,
square_grid=args.square_grid,
)
elif args.subcommand == "multi-bar":
groups, measurements = multi_bar.extract(load_json(args.data, filename=args.json_data_file))
......
......@@ -325,6 +325,7 @@ def plot(
font_size: float = None,
font: Font = {},
use_tex: bool = False,
square_grid: bool = False,
) -> matplotlib.figure.Figure:
if len(graphs) == 0:
warning("no graph to plot")
......@@ -392,6 +393,9 @@ def plot(
if x_scale == "log" or y_scale == "log":
ax.minorticks_on()
if square_grid:
ax.axis("equal")
# ======================== ticks ========================
if x_ticks is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment