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

add "use TeX" to multibar

parent 0c55949f
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,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("--use-tex", action="store_true")
common_options = [
{
......@@ -203,6 +204,7 @@ if __name__ == "__main__":
args.title,
args.label,
plot_layout=plot_layout,
use_tex=args.use_tex,
)
if fig is None:
......
......@@ -6,9 +6,10 @@ import numpy as np
import json
import sys
import argparse
import shutil
from error import GPLTError
from log import panic
from log import panic, warning
HELP="""# Example
......@@ -69,10 +70,20 @@ def multi_bar(
nb_legend_cols: int = 3,
legend_loc: str = "upper left",
plot_layout: str = "constrained",
use_tex: bool = False,
) -> matplotlib.figure.Figure:
if labels_locations is None:
labels_locations = np.arange(len(groups))
if use_tex:
if shutil.which("latex") is None:
warning("LaTeX is not installed, using default rendering")
else:
plt.rcParams.update({
"text.usetex": True,
'text.latex.preamble': r'\usepackage{amsfonts}'
})
fig, ax = plt.subplots(layout=plot_layout)
for i, (attribute, measurement) in enumerate(measurements.items()):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment