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 --- 163 unchanged lines hidden (view full) --- 172 colors = array(colors) 173 174 self.figure = pylab.figure(figsize=self.chart_size) 175 176 outer_axes = None 177 inner_axes = None 178 if self.xsubticks is not None: 179 color = self.figure.get_facecolor() |
180 self.metaaxes = self.figure.add_axes(self.figure_size, 181 axisbg=color, frameon=False) |
182 for tick in self.metaaxes.xaxis.majorTicks: 183 tick.tick1On = False 184 tick.tick2On = False 185 self.metaaxes.set_yticklabels([]) 186 self.metaaxes.set_yticks([]) 187 size = [0] * 4 188 size[0] = self.figure_size[0] 189 size[1] = self.figure_size[1] + .12 --- 45 unchanged lines hidden (view full) --- 235 elif self.ylim is not None: 236 self.inner_axes.set_ylim(self.ylim) 237 238 if self.xticks is not None: 239 outer_axes.set_xticks(arange(cshape[2]) + .5) 240 outer_axes.set_xticklabels(self.xticks) 241 242 if self.xsubticks is not None: |
243 numticks = (cshape[0] + 1) * cshape[2] 244 inner_axes.set_xticks(arange(numticks) * width + 2 * center) |
245 self.xsubticks.append('') |
246 inner_axes.set_xticklabels(self.xsubticks * cshape[2], fontsize=7, 247 rotation=90) |
248 249 if self.legend is not None: 250 if dim == 1: 251 lbars = bars[0][0] 252 if dim == 2: 253 lbars = [ bars[i][0][0] for i in xrange(len(bars))] 254 if dim == 3: 255 number = len(bars[0]) --- 23 unchanged lines hidden (view full) --- 279 f.write(', '.join([ '%f' % val for val in data]) + '\n') 280 if dim == 2: 281 #if self.xlabel: 282 # f.write(', '.join([''] + list(self.xlabel)) + '\n') 283 for i,row in enumerate(data): 284 ylabel = [] 285 #if self.ylabel: 286 # ylabel = [ self.ylabel[i] ] |
287 f.write(', '.join(ylabel + [ '%f' % v for v in row]) + '\n') |
288 if dim == 3: 289 f.write("don't do 3D csv files\n") 290 pass 291 292 f.close() 293 294if __name__ == '__main__': 295 from random import randrange --- 46 unchanged lines hidden --- |