Commit 1ca6cf1e authored by Marcel Henrik Schubert's avatar Marcel Henrik Schubert
Browse files

changes to plots

parent 19b2c0eb
......@@ -98,13 +98,14 @@ def plot_confusion_matrix(cm, classes,normalize=True,title='Confusion matrix',cm
ax = plt.gca()
cm_old = cm
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
print("Normalized confusion matrix")
else:
print('Confusion matrix, without normalization')
#print(cm)
cm_old = cm
im = ax.imshow(cm, interpolation='nearest', cmap=cmap)
......@@ -614,11 +615,14 @@ def plotter(subsets, subana, phases, labels):
f= plt.figure(figsize=(10,5))
f= plt.figure(figsize=(5,10))
tmp_df =pd.DataFrame(tmp_sub, index = ind_sub)
tmp_df.plot(kind='barh', colormap = cmap, ax=f.gca())
plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5)) #legend outside box
plt.ylabel(ylabel='Evaluation Measures for Different Groups',fontsize ='large', fontweight='roman')
tmp_df.plot(kind='bar', colormap = cmap, ax=f.gca())
plt.legend(loc='upper right') #legend outside box
plt.xlabel(xlabel='Evaluation Measures for Different Groups',fontsize ='large', fontweight='roman')
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.grid(True, axis ='y')
plt.ylim((0,0.6))
plt.tight_layout()
plt.savefig(savedir+'barplots/age_scores_{}_{}.pdf'.format(st, an))
plt.savefig(savedir+'barplots/age_scores_{}_{}.png'.format(st, an))
......@@ -701,15 +705,20 @@ def plotter(subsets, subana, phases, labels):
average='weighted').round(3)}
tmp_sub.append(comp_sub)
ind_sub.append('age phase {}'.format(ph))
ind_sub.append('age phase {}'.format(ph))
f= plt.figure(figsize=(10,5))
f= plt.figure(figsize=(5, 10))
tmp_df =pd.DataFrame(tmp_sub, index = ind_sub)
tmp_df.plot(kind='barh', colormap = cmap, ax=f.gca())
plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5)) #legend outside box
plt.ylabel(ylabel='Evaluation Measures for Different Groups',fontsize ='large', fontweight='roman')
tmp_df.plot(kind='bar', colormap = cmap, ax=f.gca())
plt.legend(loc='upper right')
plt.xlabel(xlabel='Evaluation Measures for Different Groups',fontsize ='large', fontweight='roman')
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.grid(True, axis ='y')
plt.ylim((0,0.6))
plt.tight_layout()
plt.savefig(savedir+'barplots/author_scores_{}_{}.pdf'.format(st, an))
plt.savefig(savedir+'barplots/author_scores_{}_{}.png'.format(st, an))
......@@ -803,8 +812,11 @@ def plotter(subsets, subana, phases, labels):
tmp_df =pd.DataFrame(tmp, index = index)
tmp_df.plot(kind='bar', colormap = cmap, ax=f.gca())
#plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5)) #legend outside box
plt.legend(loc='upper right')
plt.legend(loc='upper left')
plt.xlabel(xlabel='Evaluation Measures for Different Subsets',fontsize ='large', fontweight='roman')
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.grid(True, axis ='y')
plt.ylim((0,0.7))
plt.tight_layout()
plt.savefig(savedir+'barplots/overall_scores_{}_{}.pdf'.format(st, an))
plt.savefig(savedir+'barplots/overall_scores_{}_{}.png'.format(st, an))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment