@@ -17,12 +17,18 @@ def getProblemList():
1717
1818def plot ( data , title , filename ):
1919 mean = np .average ( data )
20+ median = np .median ( data )
21+ mode = max ( np .histogram ( data )[1 ] )
2022 bins = np .linspace (math .ceil (min (data )),math .floor (max (data )),20 )
2123 plt .xlim ([min (data ), max (data )])
2224 plt .hist (data , bins = bins , alpha = 0.5 )
23- plt .axvline ( mean , color = 'k' , linestyle = 'dashed' , linewidth = 1 )
25+ plt .axvline ( mean , color = 'r' , linestyle = 'dashed' , linewidth = 1 , marker = '^' )
26+ plt .axvline ( median , color = 'g' , linestyle = 'dashed' , linewidth = 1 , marker = 's' )
27+ plt .axvline ( mode , color = 'b' , linestyle = 'dashed' , linewidth = 1 , marker = 'o' )
2428 min_ylim , max_ylim = plt .ylim ()
25- plt .text ( mean * 1.1 , max_ylim * 0.9 , 'Mean: {:.2f}' .format ( mean ) )
29+ plt .text ( mean , max_ylim * 0.33 , 'Mean: {:.2f}' .format ( mean ), color = 'r' , rotation = 270 )
30+ plt .text ( median , max_ylim * 0.66 , 'Median: {:.2f}' .format ( median ), color = 'g' , rotation = 270 )
31+ plt .text ( mode , max_ylim * 0.90 , 'Mode: {:.2f}' .format ( mode ), color = 'b' , rotation = 270 )
2632 plt .title ( title )
2733 plt .xlabel ( 'percentile' )
2834 plt .ylabel ( '# results' )
0 commit comments