summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-10-01 08:40:50 +0200
committerLars-Dominik Braun <lars@6xq.net>2019-10-01 08:41:47 +0200
commit474f3976eeecb1f36fa8bca2e508f4e8176a28bd (patch)
tree0e7a53bc81ae1a16224e97c57faba451e812ffd7
parent232885b55e2796d847cbdd18322da27e1e86aed7 (diff)
downloadlulua-474f3976eeecb1f36fa8bca2e508f4e8176a28bd.tar.gz
lulua-474f3976eeecb1f36fa8bca2e508f4e8176a28bd.tar.bz2
lulua-474f3976eeecb1f36fa8bca2e508f4e8176a28bd.zip
plot: Swap left/right axis for letterfreq
-rw-r--r--lulua/plot.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lulua/plot.py b/lulua/plot.py
index 14b9732..2d28347 100644
--- a/lulua/plot.py
+++ b/lulua/plot.py
@@ -79,15 +79,15 @@ def letterfreq (args):
plot_width=1000,
plot_height=500,
x_range=xlabel,
- y_range=(0, max (ydata)),
+ y_range=(0, 1),
sizing_mode='scale_both',
tooltips=[('frequency', '@rel'), ('cumulative', '@cumRel'), ('count', '@abs')],
)
- p.vbar(x='letters', width=0.5, top='rel', color="#dc322f", source=source)
+ p.line ('letters', 'cumRel', source=source, line_width=2)
- p.extra_y_ranges = {"cum": Range1d()}
- p.line ('letters', 'cumRel', source=source, y_range_name='cum', line_width=2)
- p.add_layout(LinearAxis(y_range_name="cum"), 'right')
+ p.extra_y_ranges = {"single": Range1d (0, max (ydata))}
+ p.vbar(x='letters', width=0.5, top='rel', color="#dc322f", source=source, y_range_name='single')
+ p.add_layout(LinearAxis(y_range_name="single"), 'right')
# styling
p.xgrid.grid_line_color = None