comparison scripts/score_plot.py @ 1067:8d0061336b90

Scripts: timeline with rectangles (accurate start and end, customisable width); timeline and score plots to PDF by default.
author Brecht De Man <BrechtDeMan@users.noreply.github.com>
date Tue, 11 Aug 2015 11:06:55 +0200
parents a2a245542ae6
children 2ea78697aadf
comparison
equal deleted inserted replaced
1066:a2a245542ae6 1067:8d0061336b90
83 if float(arg)>0 and float(arg)<1: 83 if float(arg)>0 and float(arg)<1:
84 confidence = float(arg) 84 confidence = float(arg)
85 else: 85 else:
86 print "WARNING: The confidence value needs to be between 0 and 1" 86 print "WARNING: The confidence value needs to be between 0 and 1"
87 87
88 # FOLDER NAME 88 # FOLDER NAME
89 else: 89 else:
90 # assume it's the folder name 90 # assume it's the folder name
91 rating_folder = arg 91 rating_folder = arg
92 #TODO try it exists, otherwise show exception
93 92
94 # at least one plot type should be selected: box plot by default 93 # at least one plot type should be selected: box plot by default
95 if not enable_boxplot and not enable_confidence and not enable_individual: 94 if not enable_boxplot and not enable_confidence and not enable_individual:
96 enable_boxplot = True 95 enable_boxplot = True
97 96
228 # SAVE PLOT 227 # SAVE PLOT
229 # automatically 228 # automatically
230 plot_type = ("-box" if enable_boxplot else "") + \ 229 plot_type = ("-box" if enable_boxplot else "") + \
231 ("-conf" if enable_confidence else "") + \ 230 ("-conf" if enable_confidence else "") + \
232 ("-ind" if enable_individual else "") 231 ("-ind" if enable_individual else "")
233 plt.savefig(rating_folder+page_name+plot_type+".png") 232 plt.savefig(rating_folder+page_name+plot_type+".pdf", bbox_inches='tight')
234 plt.close() 233 plt.close()