Skip to content
Snippets Groups Projects
Unverified Commit 42ace882 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

add `--use-tex` to `plot`

parent 15bbca6b
Branches
Tags 0.5.0
No related merge requests found
......@@ -62,6 +62,7 @@ if __name__ == "__main__":
plot_parser.add_argument("--fig-size", type=float, nargs=2, default=[16, 9], help="the size, in inches, of the saved image")
plot_parser.add_argument("--dpi", type=int, default=500, help="the Dots Per Inch (DPI) of the saved image")
plot_parser.add_argument("--font", type=str, default="", help="the font parameters")
plot_parser.add_argument("--use-tex", action="store_true")
multi_bar_parser = subparsers.add_parser(
"multi-bar",
......@@ -107,6 +108,7 @@ if __name__ == "__main__":
y_ticks=args.y_ticks,
y_tick_labels=args.y_tick_labels,
font=json.loads(args.font),
use_tex=args.use_tex,
save=os.path.expanduser(args.save) if args.save else None,
save_fig_size=args.fig_size,
save_dpi=args.dpi,
......
......@@ -123,8 +123,12 @@ def plot(
y_tick_labels: List[str] = None,
font_size: float = None,
font: Font = {},
use_tex: bool = False,
):
plt.rc("font", **font)
plt.rcParams.update({
"text.usetex": use_tex,
})
fig, ax = plt.subplots(layout=plot_layout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment