From 474f3976eeecb1f36fa8bca2e508f4e8176a28bd Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 1 Oct 2019 08:40:50 +0200 Subject: plot: Swap left/right axis for letterfreq --- lulua/plot.py | 10 +++++----- 1 file 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 -- cgit v1.2.3