You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I enjoy using this library, but recently the histograms were not working as should. There were no bars for numeric values, only an empty graph. For integers there was no problem...
This works as a charm when binwidths are known and it produces proper histograms at the same time, since there should be no gap between bars in a histogram!
Although this does not work when the binwidth is not set, maybe the binwidth calculation from (https://github.com/edgararuiz/dbplot/blob/master/R/dbbin.R) could be included somehow?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
@leungi A more general (and backwards compatible) solution is to bubble up the "orientation" argument to the "dbplot_histogram" function with a default value of NA. In this way, users who call the dbplot_histogram() function without the "orientation" argument will get exactly the same behavior, but users who prefer to set the orientation (most probably because the auto-detection of orientation fails) can set it in "dbplot_histogram" and it will get passed to the "geom_col()" call.
I enjoy using this library, but recently the histograms were not working as should. There were no bars for numeric values, only an empty graph. For integers there was no problem...
Solution: change line 92 in https://github.com/edgararuiz/dbplot/blob/master/R/histogram.R
92 (old) geom_col(aes(x, count)) +
92 (new) geom_col(aes(x, count), orientation="x", width = binwidth) +
This works as a charm when binwidths are known and it produces proper histograms at the same time, since there should be no gap between bars in a histogram!
Although this does not work when the binwidth is not set, maybe the binwidth calculation from (https://github.com/edgararuiz/dbplot/blob/master/R/dbbin.R) could be included somehow?
Thanks in advance!
The text was updated successfully, but these errors were encountered: