Skip to content

Commit

Permalink
Stop passing both nbins and edges to histogram (#102)
Browse files Browse the repository at this point in the history
Fixes #101
  • Loading branch information
mrkn authored May 16, 2024
1 parent 79796da commit fecb7ee
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 fecb7ee

Please sign in to comment.