Skip to content

Commit

Permalink
chore(histogram): display number for Y-axis instead of probability (#430
Browse files Browse the repository at this point in the history
)

* chore(histogram): display number instead of probability

Signed-off-by: takeshi.iwanari <[email protected]>

* fix: change hover label

Signed-off-by: takeshi.iwanari <[email protected]>

---------

Signed-off-by: takeshi.iwanari <[email protected]>
  • Loading branch information
iwatake2222 authored Nov 14, 2023
1 parent b2a3eda commit e14022e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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]] = []
Expand Down Expand Up @@ -269,14 +269,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)

Expand Down

0 comments on commit e14022e

Please sign in to comment.