Skip to content

Commit

Permalink
Stop passing both nbins and edges to histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn committed May 16, 2024
1 parent 79796da commit 971d823
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/charty/plotters/histogram_plotter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ def kde_params=(val)
observations = sub_data[data_variable].drop_na.to_a
params = {}
params[:weights] = sub_data[:weights].to_a if sub_data.column?(:weights)
params[:edges] = common_bin_edges if common_bin_edges
hist = Statistics.histogram(observations, bins, **params)
hist = if common_bin_edges
Statistics.histogram(observations, edges: common_bin_edges, **params)
else
Statistics.histogram(observations, bins, **params)
end

name = sub_vars[:color]
backend.univariate_histogram(hist, name, data_variable, stat,
Expand Down

0 comments on commit 971d823

Please sign in to comment.