changeset 1025:a90495a060de

Scripts: in score plots (individual and boxplot), remove extra marker in legend; automatically save plot.
author Brecht De Man <BrechtDeMan@users.noreply.github.com>
date Sat, 06 Jun 2015 11:54:43 +0100
parents 75302b775a4d
children f13b6efc4513
files scripts/score_boxplot.py scripts/score_individual.py
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/score_boxplot.py	Fri Jun 05 13:26:31 2015 +0100
+++ b/scripts/score_boxplot.py	Sat Jun 06 11:54:43 2015 +0100
@@ -64,8 +64,7 @@
         plt.ylabel('Rating')
         plt.ylim(0,1)
 
-        plt.show()
+        #plt.show() # show plot
         #exit()
 
-        #TODO Save output automatically
-
+        plt.savefig(rating_folder+page_name+"-ind.png")
--- a/scripts/score_individual.py	Fri Jun 05 13:26:31 2015 +0100
+++ b/scripts/score_individual.py	Sat Jun 06 11:54:43 2015 +0100
@@ -9,7 +9,7 @@
 markerlist = ["x", ".", "o", "*", "+", "v", ">", "<", "8", "s", "p"]
 
 # get every csv file in folder
-for file in os.listdir(rating_folder): # You have to put this in folder where rating csv files are.
+for file in os.listdir(rating_folder):
     if file.endswith(".csv"):
         page_name = file[:-4] # file name (without extension) is page ID
 
@@ -47,13 +47,14 @@
 
             plt.legend(linehandles, legendnames,
                        loc='upper right',
-                       bbox_to_anchor=(1.1, 1), borderaxespad=0.)
+                       bbox_to_anchor=(1.1, 1),
+                       borderaxespad=0.,
+                       numpoints=1 # remove extra marker
+                       )
 
             #TODO Put legend outside of box
-            #TODO Why two markers in legend?
 
-            plt.show()
+            #plt.show() # show plot
             #exit()
 
-            #TODO Save output automatically
-
+            plt.savefig(rating_folder+page_name+"-ind.png")