Skip to content

Commit 8456aa1

Browse files
committed
boxplot code
1 parent b3b81dc commit 8456aa1

File tree

5 files changed

+81
-0
lines changed

5 files changed

+81
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

analysis/.DS_Store

0 Bytes
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# import pandas
2+
import pandas as pd
3+
# import matplotlib
4+
import matplotlib.pyplot as plt
5+
# import seaborn
6+
import seaborn as sns
7+
8+
import numpy as np
9+
10+
11+
fig, axes = plt.subplots(1, 2)
12+
13+
axes[0].set_title('Helpfulness')
14+
axes[1].set_title('Importance')
15+
16+
data_list = ['saelyne_data_helpfulness.csv', 'saelyne_data_importance.csv']
17+
18+
19+
for i, filename in enumerate(data_list):
20+
axes[i].set_ylim([0, 5.5])
21+
22+
df = pd.read_csv(filename, sep='\t')
23+
24+
df_values = df.loc[:, df.columns != 'Task']
25+
df_melt = pd.melt(df_values)
26+
27+
num_col = len(df_values.columns)
28+
df_task = df.iloc[:, 0]
29+
df_task = pd.concat([df_task] * num_col, ignore_index=True)
30+
31+
32+
df_melt['Task'] = df_task.values
33+
34+
axes[i].set_xticklabels(df_values.columns, rotation=45)
35+
36+
ax = sns.boxplot(ax=axes[i], x="variable", y="value", data=df_melt,
37+
palette="Set2", hue="Task")
38+
ax.set(ylabel=None, xlabel=None)
39+
ax.legend(ncol=3)
40+
41+
fig.tight_layout(pad=2.0)
42+
43+
plt.show()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Task Greeting Overview Method Supplementary Explanation Description Conclusion Misc
2+
Summary 5 5 5 5 5 5 5 5
3+
Summary 1 3 5 4 4 4 2 1
4+
Summary 5 5 5 5 4 5 5 5
5+
Summary 5 5 5 5 5 5 5 5
6+
Summary 5 5 5 5 5 4 5 5
7+
Summary 5 5 5 5 5 5 5 5
8+
Summary 3 3 5 3 4 4 4 4
9+
Summary 5 5 5 5 5 5 5 5
10+
Summary 5 5 5 5 5 5 5 5
11+
Follow 1 4 5 3 4 3 1 1
12+
Follow 1 1 5 3 4 3 1 1
13+
Follow 5 5 5 5 5 5 5 5
14+
Follow 5 5 5 5 5 5 5 5
15+
Follow 5 5 5 5 5 5 5 5
16+
Follow 3 4 5 5 5 4 5 5
17+
Follow 5 4 5 4 5 4 4 5
18+
Follow 5 5 5 5 5 5 5 5
19+
Follow 5 5 5 5 5 5 5 5
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Task Greeting Overview Method Supplementary Explanation Description Conclusion Misc
2+
Summary 2 5 5 3 4 3 3 1
3+
Summary 1 4 5 4 4 5 2 1
4+
Summary 2 3 5 4 4 4 2 1
5+
Summary 1 2 5 2 2 3 1 1
6+
Summary 1 5 5 2 2 1 5 1
7+
Summary 1 4 5 4 2 3 3 1
8+
Summary 1 5 5 4 4 3 4 1
9+
Summary 1 4 4 4 4 4 3 1
10+
Summary 1 5 5 3 4 4 2 1
11+
Follow 1 5 5 5 5 4 2 1
12+
Follow 1 1 5 3 4 3 1 1
13+
Follow 1 4 5 4 1 5 4 1
14+
Follow 1 2 5 5 5 3 1 1
15+
Follow 1 4 5 5 5 4 1 1
16+
Follow 3 4 5 5 5 5 4 1
17+
Follow 5 5 5 3 5 4 5 1
18+
Follow 1 5 5 3 3 3 3 1
19+
Follow 1 4 5 4 4 4 4 1

0 commit comments

Comments
 (0)