summaryrefslogtreecommitdiff
path: root/util/stats/barchart.py
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2006-02-25 23:48:13 -0500
committerNathan Binkert <binkertn@umich.edu>2006-02-25 23:48:13 -0500
commit46189e9e2b4d36cb2aa3587919cb4d532118fa9c (patch)
tree3386c884b508d43379b338e11cb312bb290b2d28 /util/stats/barchart.py
parent63db9860cf4ef1bfdfe97bf7f276c27dc5d13eea (diff)
downloadgem5-46189e9e2b4d36cb2aa3587919cb4d532118fa9c.tar.xz
better colors for barcharts
util/stats/barchart.py: If there are fewer than 5 colors, pick from a subset of 5 so there is more consistency in colors between graphs --HG-- extra : convert_revision : 6cf64c2f8ed81e714e24a3ebe5a7a60ca168b231
Diffstat (limited to 'util/stats/barchart.py')
-rw-r--r--util/stats/barchart.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/stats/barchart.py b/util/stats/barchart.py
index dd3bf0180..87d0eb5bb 100644
--- a/util/stats/barchart.py
+++ b/util/stats/barchart.py
@@ -47,8 +47,11 @@ class BarChart(ChartOptions):
cmap = matplotlib.cm.get_cmap(self.colormap)
if count == 1:
return cmap([ 0.5 ])
- else:
- return cmap(arange(count) / float(count - 1))
+
+ if count < 5:
+ return cmap(arange(5) / float(4))[:count]
+
+ return cmap(arange(count) / float(count - 1))
# The input data format does not match the data format that the
# graph function takes because it is intuitive. The conversion