Mercurial > hg > numerics
comparison numerics/bar.py @ 107:19a5c2fb52bb
add transpose functionality
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 15 Mar 2015 10:02:48 -0700 |
parents | 889728b8d359 |
children | 7578313b9fbf |
comparison
equal
deleted
inserted
replaced
106:895ad896023a | 107:19a5c2fb52bb |
---|---|
17 from .read import CSVParser | 17 from .read import CSVParser |
18 from bokeh.charts import Bar | 18 from bokeh.charts import Bar |
19 from bokeh.plotting import * | 19 from bokeh.plotting import * |
20 from collections import OrderedDict | 20 from collections import OrderedDict |
21 | 21 |
22 __all__ = ['bar_chart', 'main'] | 22 __all__ = ['bar_chart', 'BarChartParser', 'main'] |
23 | 23 |
24 def bar_chart(data, output, title=None): | 24 def bar_chart(data, output, title=None): |
25 """create a bar chart""" | 25 """create a bar chart""" |
26 | 26 |
27 bar = Bar(data, tools="pan,wheel_zoom,box_zoom,reset,resize") | 27 bar = Bar(data, tools="pan,wheel_zoom,box_zoom,reset,resize") |
28 bar.filename(output) | 28 bar.filename(output) |
29 bar.width(len(data)*50) | 29 bar.width(len(data)*50) |
30 bar.show() | 30 bar.show() |
31 | |
31 | 32 |
32 class BarChartParser(CSVParser): | 33 class BarChartParser(CSVParser): |
33 """command line options parser for bar charts""" | 34 """command line options parser for bar charts""" |
34 # TODO: upstream to PlotParser | 35 # TODO: upstream to PlotParser |
35 | 36 |