diff options
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 58d2b03..f459d9a 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -2330,6 +2330,8 @@ proc UpdateColumnGradesHistogram { columnname } { set maxVal [::math::statistics::max $col_values ]; # fixme should it be _Max_Points_? set minVal 0 set barsNum 10; + set uniqNum [llength [lsort -unique $col_values]] + set barsNum [expr {min($uniqNum, $barsNum)}]; # heuristic about number of bars/intervals set limits [::math::statistics::minmax-histogram-limits $minVal $maxVal [incr barsNum]] set limits [lrange $limits 1 end-1]; # shave first and last interval limits set hist [::math::statistics::histogram $limits $col_values ] |