Skip to content

Commit 7587330

Browse files
final graph plotting code
1 parent a4564a2 commit 7587330

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

scripts/plotting/plot_vlm_pred_invent_results.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Define the data for each environment
1212
data_coffee = {
1313
'EXPERIMENT_ID': [
14-
'VLM feat. pred', 'Ours', 'No feat.', 'No invent',
14+
'VLM feat. pred', 'Ours (pix2pred)', 'No feat.', 'No invent',
1515
'No subselect', 'No visual', 'VLM subselect',
1616
'ViLa', 'ViLa fewshot'
1717
],
@@ -21,7 +21,7 @@
2121

2222
data_combo_burger = {
2323
'EXPERIMENT_ID': [
24-
'VLM feat. pred', 'Ours', 'No feat.', 'No invent',
24+
'VLM feat. pred', 'Ours (pix2pred)', 'No feat.', 'No invent',
2525
'No subselect', 'No visual', 'VLM subselect',
2626
'ViLa', 'ViLa fewshot'
2727
],
@@ -31,7 +31,7 @@
3131

3232
data_fatter_burger = {
3333
'EXPERIMENT_ID': [
34-
'VLM feat. pred', 'Ours', 'No feat.', 'No invent',
34+
'VLM feat. pred', 'Ours (pix2pred)', 'No feat.', 'No invent',
3535
'No subselect', 'No visual', 'VLM subselect',
3636
'ViLa', 'ViLa fewshot'
3737
],
@@ -41,7 +41,7 @@
4141

4242
data_more_stacks = {
4343
'EXPERIMENT_ID': [
44-
'VLM feat. pred', 'Ours', 'No feat.', 'No invent',
44+
'VLM feat. pred', 'Ours (pix2pred)', 'No feat.', 'No invent',
4545
'No subselect', 'No visual', 'VLM subselect',
4646
'ViLa', 'ViLa fewshot'
4747
],
@@ -51,7 +51,7 @@
5151

5252
data_kitchen_boil_kettle = {
5353
'EXPERIMENT_ID': [
54-
'VLM feat. pred', 'Ours', 'No feat.', 'No invent',
54+
'VLM feat. pred', 'Ours (pix2pred)', 'No feat.', 'No invent',
5555
'No subselect', 'No visual', 'VLM subselect',
5656
'ViLa', 'ViLa fewshot'
5757
],
@@ -68,7 +68,7 @@
6868

6969
# Reorder the 'EXPERIMENT_ID' column to match 'custom_order'
7070
custom_order = [
71-
'Ours', 'VLM subselect', 'No subselect', 'No feat.', 'No visual', 'No invent',
71+
'Ours (pix2pred)', 'VLM subselect', 'No subselect', 'No feat.', 'No visual', 'No invent',
7272
'VLM feat. pred', 'ViLa', 'ViLa fewshot'
7373
]
7474

@@ -86,28 +86,38 @@
8686
fig, axes = plt.subplots(1, 5, figsize=(18, 6), sharey=True)
8787

8888
# Assign a larger color palette for the bars, so that each bar has a unique color
89-
unique_palette = sns.color_palette("pastel", n_colors=len(df_combo_burger))
89+
# unique_palette = sns.color_palette("pastel", n_colors=len(df_combo_burger))
90+
91+
# Define custom colors for the bars (replace these with your hex codes)
92+
custom_colors = [
93+
"#10a37f", "#e45756", "#f58518", "#ffbf00", "#b5d33d",
94+
"#6ec1e4", "#b980d1", "#444444", "#d8b88f"
95+
]
96+
97+
# Repeat the custom colors for each environment if necessary
98+
custom_palette = custom_colors * (len(df_combo_burger) // len(custom_colors) + 1)
99+
90100

91101
# Plot in the new order: 'Boil Kettle', 'More Stacks', 'Bigger Burger', 'Combo Burger', then Coffee
92102
environments = [df_kitchen_boil_kettle, df_fatter_burger, df_more_stacks, df_combo_burger, df_coffee]
93103
titles = ["Kitchen Boil Kettle", "Bigger Burger", "More Burger Stacks", "Combo Burger", "Coffee"]
94104

95105
for i, (df, title) in enumerate(zip(environments, titles)):
96106
sns.barplot(
97-
data=df, y='EXPERIMENT_ID', x='NUM_SOLVED', ax=axes[i], palette=unique_palette, capsize=0.1
107+
data=df, y='EXPERIMENT_ID', x='NUM_SOLVED', ax=axes[i], palette=custom_palette[:len(df)], capsize=0.1
98108
)
99109
axes[i].errorbar(
100110
df['NUM_SOLVED'], df['EXPERIMENT_ID'],
101111
xerr=df['NUM_SOLVED_SE'], fmt='none', c='black', capsize=5, capthick=1
102112
)
103113
axes[i].set_title(title, fontsize=20) # Increase title font size
104114
axes[i].set_xlabel('') # Clear individual x-labels
105-
axes[i].set_ylabel('', fontsize=16) # Increase y-label font size
106-
axes[i].tick_params(axis='both', labelsize=14) # Increase tick label size
115+
axes[i].set_ylabel('', fontsize=19) # Increase y-label font size
116+
axes[i].tick_params(axis='both', labelsize=18) # Increase tick label size
107117
axes[i].grid(True, linestyle='--', alpha=0.6) # Add gridlines for clarity
108118

109119
# Set shared x-label
110-
fig.text(0.5, 0.01, '% Evaluation Tasks Solved', ha='center', fontsize=18)
120+
fig.text(0.5, 0.01, '% Evaluation Tasks Solved', ha='center', fontsize=19)
111121

112122
# Adjust layout with tighter spacing
113123
plt.tight_layout(rect=[0.02, 0.05, 1, 1])

0 commit comments

Comments
 (0)