barchart.py (2160:d851e177e4c6) | barchart.py (2179:7e15ffdd03d8) |
---|---|
1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 33 unchanged lines hidden (view full) --- 42 super(BarChart, self).__init__(default, **kwargs) 43 self.inputdata = None 44 self.chartdata = None 45 46 def gen_colors(self, count): 47 cmap = matplotlib.cm.get_cmap(self.colormap) 48 if count == 1: 49 return cmap([ 0.5 ]) | 1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 33 unchanged lines hidden (view full) --- 42 super(BarChart, self).__init__(default, **kwargs) 43 self.inputdata = None 44 self.chartdata = None 45 46 def gen_colors(self, count): 47 cmap = matplotlib.cm.get_cmap(self.colormap) 48 if count == 1: 49 return cmap([ 0.5 ]) |
50 else: 51 return cmap(arange(count) / float(count - 1)) | |
52 | 50 |
51 if count < 5: 52 return cmap(arange(5) / float(4))[:count] 53 54 return cmap(arange(count) / float(count - 1)) 55 |
|
53 # The input data format does not match the data format that the 54 # graph function takes because it is intuitive. The conversion 55 # from input data format to chart data format depends on the 56 # dimensionality of the input data. Check here for the 57 # dimensionality and correctness of the input data 58 def set_data(self, data): 59 if data is None: 60 self.inputdata = None --- 237 unchanged lines hidden --- | 56 # The input data format does not match the data format that the 57 # graph function takes because it is intuitive. The conversion 58 # from input data format to chart data format depends on the 59 # dimensionality of the input data. Check here for the 60 # dimensionality and correctness of the input data 61 def set_data(self, data): 62 if data is None: 63 self.inputdata = None --- 237 unchanged lines hidden --- |