Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to summary_chart.py #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions experiments/summary_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def make_sub_chart(batch_size_idx, techniques, df, ax, title, category_column, v
y_values = []
bar_colors = []
x_idx = 0

#Prepare data for plotting on chart
for key in techniques.keys():
if key in df[category_column].tolist():
x_values.append(key)
Expand All @@ -19,21 +21,27 @@ def make_sub_chart(batch_size_idx, techniques, df, ax, title, category_column, v
else:
x_values.append(key)
y_values.append(0)

x_coords = []
for name in df[category_column]:
if name in techniques:
x_coords.append(techniques[name])

# Plot bar chart on provided axis
ax.bar(x_values, y_values, label=label, color=bar_colors)

# Customize the chart labels and title
ax.set_xlabel(category_column)
ax.set_ylabel(value_column)
ax.set_title(title)

# Specify y-axis limits
if ylim_low is None:
assert ylim_high is None
else:
ax.set_ylim(ylim_low, ylim_high)

# Format dashed lines
tick_positions = ax.get_yticks()
for tick in tick_positions:
ax.axhline(y=tick, color='gray', linestyle='--', alpha=0.7)
Expand Down
Loading