allow -c list, fix bar colors
This commit is contained in:
parent
983598c5b0
commit
49fe263577
1 changed files with 6 additions and 2 deletions
8
smem
8
smem
|
|
@ -390,7 +390,8 @@ def showsystem():
|
|||
showtable(range(len(l)), fields, columns.split(), options.sort or 'order')
|
||||
|
||||
def showfields(fields, f):
|
||||
print "unknown field", f
|
||||
if f != list:
|
||||
print "unknown field", f
|
||||
print "known fields:"
|
||||
for l in sorted(fields.keys()):
|
||||
print "%-8s %s" % (l, fields[l][-1])
|
||||
|
|
@ -521,11 +522,14 @@ def showbar(l, columns, sort):
|
|||
width = 1.0 / (len(rc) + 1)
|
||||
offset = width / 2
|
||||
|
||||
def gc(n):
|
||||
return 'bgrcmyw'[n % 7]
|
||||
|
||||
pl = []
|
||||
ind = numpy.arange(len(l))
|
||||
for n in xrange(len(rc)):
|
||||
pl.append(pylab.bar(ind + offset + width * n,
|
||||
[x[1][rc[n]] for x in l], width))
|
||||
[x[1][rc[n]] for x in l], width, color=gc(n)))
|
||||
|
||||
#plt.xticks(ind + .5, )
|
||||
pylab.legend([p[0] for p in pl], key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue