From 57cb877b7510ba4e117f4c75a8e4914fb482e515 Mon Sep 17 00:00:00 2001 From: iwatake Date: Tue, 14 Nov 2023 15:34:46 +0900 Subject: [PATCH] chore(histogram): display number for Y-axis instead of probability (#430) * chore(histogram): display number instead of probability Signed-off-by: takeshi.iwanari * fix: change hover label Signed-off-by: takeshi.iwanari --------- Signed-off-by: takeshi.iwanari --- src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py b/src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py index 3491ecf07..b6e1e6e79 100644 --- a/src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py +++ b/src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py @@ -224,7 +224,7 @@ def histogram( plot: Figure = Figure( title=f'Histogram of {data_type}' if case is None else f'Histogram of {data_type} --- {case} case ---', - x_axis_label=x_label, y_axis_label='Probability', width=800 + x_axis_label=x_label, y_axis_label='The number of samples', width=800 ) data_list: list[list[int]] = [] @@ -276,14 +276,14 @@ def histogram( ) for hist_type, target_object in zip(data_list, target_objects): - hist, bins = histogram(hist_type, 20, (min_value, max_value), density=True) + hist, bins = histogram(hist_type, 20, (min_value, max_value), density=False) quad = plot.quad(top=hist, bottom=0, left=bins[:-1], right=bins[1:], line_color='white', alpha=0.5, color=color_selector.get_color()) legend_manager.add_legend(target_object, quad) hover = HoverTool( - tooltips=[(x_label, '@left'), ('Probability', '@top')], renderers=[quad] + tooltips=[(x_label, '@left'), ('The number of samples', '@top')], renderers=[quad] ) plot.add_tools(hover)