Skip to content
Snippets Groups Projects
Commit 15d68899 authored by wiepke's avatar wiepke
Browse files

beautify boxplot

parent 98c4edeb
No related branches found
No related tags found
No related merge requests found
......@@ -229,7 +229,7 @@ def replace_cryptic_names(columns):
return new_columns
def translate_scales(scales):
def translate_scales(scales, short=False):
scales = list(scales)
result = scales
translations = {
......@@ -254,6 +254,29 @@ def translate_scales(scales):
'Akustik': "Acoustics",
'Inhaltsseriosität': "Trustworth-\niness of \nContent"
}
if short:
translations = {
'Inhaltsqualität': "Qua",
'Anpassbarkeit': "Ada",
'Durchschaubarkeit': "Dep",
'Effizienz': "Eff",
'Immersion': "Imm",
'Intuitive Bedienung': "Int",
'Nützlichkeit': "Use",
'Originalität': "Nov",
'visuelle Ästhetik': "Aes",
'Identität': "Id",
'Steuerbarkeit': "Cla",
'Stimulation': "Sti",
'Übersichtlichkeit': "Per",
'Verbundenheit': "Atm",
'Vertrauen': "Tru",
'Wertigkeit': "Val",
'Attraktivität': "Att",
'Haptik': "Hap",
'Akustik': "Aco",
'Inhaltsseriosität': "ToC"
}
for i in range(len(scales)):
result[i] = translations[scales[i]]
return result
......@@ -351,20 +374,24 @@ class Plotter:
# make a nice plot surrounding
sns.set_theme(style="whitegrid", palette="pastel")
fig = plt.figure()
fig.suptitle(category_title.value, fontsize=14, fontweight='bold', y=0.1)
fig.suptitle(category_title.value, fontsize=14, fontweight='bold', y=0.09)
fig.set_figheight(6.0)
# plot the plot
boxprops = dict(linestyle='-', facecolor='k', linewidth=3, color='k')
medianprops = dict(linestyle='-', linewidth=3, color='b')
meanprops = dict(color='b')
ax = fig.add_subplot(111)
ax.axhspan(4, 7, facecolor='green', alpha=0.2)
ax.axhspan(1, 4, facecolor='red', alpha=0.2)
ax.grid(axis='y')
ax.boxplot(df_category_area, showmeans=True, showfliers=True, patch_artist=True,
boxprops=boxprops, medianprops=medianprops, meanprops=meanprops)
ax.set_ylim(0.5, 7.5)
ax.set_xticks([tick + 1 for tick in range(len(df_category_area.columns))],
labels=translate_scales(df_category_area.columns), rotation=0)
labels=translate_scales(df_category_area.columns, True), rotation=0)
ax.xaxis.set_label_position('top')
ax.xaxis.tick_top()
......@@ -489,11 +516,11 @@ if __name__ == '__main__':
# plotter.plot_groups(variables.get_groups())
# plotter.plot_sex()
# plotter.plot_faculty()
example = Categories.VR
# plotter.plot_item(example, 'top')
plotter.plot_item(example, 'mid')
# plotter.plot_item(example, 'low')
plotter.plot_boxes(example, 6)
for example in Categories:
# plotter.plot_item(example, 'top')
plotter.plot_item(example, 'mid')
# plotter.plot_item(example, 'low')
plotter.plot_boxes(example, 6)
print(statistics.calc_corr())
print(statistics.similarity_by_ranked_scales(rankings.get_all_rankings()))
print(time.strftime('%M:%S', time.gmtime(statistics.mean_time())))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment