Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
minor bar chart change
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrusch committed Dec 11, 2023
1 parent aa9a5c4 commit c832592
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ perf:
python3 -m exp $(f) -a pgd --out result/perf/$(UNAME_S) ; )

plots:
if [ -d "$(DIR)/original" ] && [ -d "$(DIR)/attacks" ]; \
@if [ -d "$(DIR)/original" ] && [ -d "$(DIR)/attacks" ]; \
then python3 -m plot bar "$(DIR)/original,$(DIR)/attacks" --out $(DIR); fi
if [ -d "$(DIR)/reset" ] && [ -d "$(DIR)/attacks" ]; \
@if [ -d "$(DIR)/reset" ] && [ -d "$(DIR)/attacks" ]; \
then python3 -m plot bar "$(DIR)/reset,$(DIR)/attacks" --out $(DIR); fi
$(foreach d, $(PER_DIRS), \
python3 -m plot table $(d) -b $(d) --out $(DIR) && \
Expand Down
4 changes: 2 additions & 2 deletions plot/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_color_scheme(n):

def multi_bar(ax, results, cat_names, colors):
llbl, rlbl = list(zip(*[
(r, l.replace("0", "").replace("PT-1-", "")
.replace("PT-2-", "")) for (l, r), _ in results]))
(r, l.replace("0", "").replace("PT-1-", "Const-")
.replace("PT-2-", "Const-")) for (l, r), _ in results]))
uniq_rl = [x for k, v in groupby(rlbl)
for x in [k] + [' '] * (sum(1 for __ in v) - 1)]
labels = [i for i, _ in enumerate(results)]
Expand Down
Binary file modified ref_result/__bar_acc_ref_result_perf_ubuntu.pdf
Binary file not shown.

0 comments on commit c832592

Please sign in to comment.