From da07b320a49595fc770678cf836665c757d85d17 Mon Sep 17 00:00:00 2001 From: Xaseiresh Date: Tue, 7 May 2024 16:46:04 +0200 Subject: [PATCH] feat(datavis): :sparkles: tweak plotting to use commas as decimal point --- .vscode/settings.json | 3 ++- Images/Datavis/generate_plot.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8bd51bb..52cc0a6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ "latex-workshop.synctex.afterBuild.enabled": true, "latex-workshop.view.outline.sync.viewer": true, "conventionalCommits.scopes": [ - "tex" + "tex", + "datavis" ] } \ No newline at end of file diff --git a/Images/Datavis/generate_plot.py b/Images/Datavis/generate_plot.py index bf65b5a..9b8ba2b 100644 --- a/Images/Datavis/generate_plot.py +++ b/Images/Datavis/generate_plot.py @@ -60,7 +60,7 @@ def read_ltspice_file(filename, plot_config): if lre.search("^Step Information: ([^=]*)=([\d\.\+-]+)(\w?) \(Step: .*\)$", line): step_param = plot_config.get('step_parameter', lre.last_match[1]); - value = f"{round(float(lre.last_match[2]), 2)}"; + value = f"{round(float(lre.last_match[2]), 2):.2f}".replace('.', ','); unit = f"{lre.last_match[3]}{plot_config.get('step_unit', '')}"; current_step = "{value:>6s} {unit:s}".format(value=value, unit=unit);