AndriSignorell / DescTools

Tools for Descriptive Statistics and Exploratory Data Analysis
http://andrisignorell.github.io/DescTools/
86 stars 18 forks source link

Fix legend when breaks is specified. #87

Closed dmurdoch closed 2 years ago

dmurdoch commented 2 years ago

This fixes issue #86 .

dmurdoch commented 2 years ago

The digits calculation I did is appropriate for evenly spaced breaks. It might make sense to base it on the smallest gap instead. In that case, I think a reasonable formula would be

digits <- round(-log10(min(diff(breaks))))

but I haven't tested that; I don't know of any real use cases for uneven breaks.

AndriSignorell commented 2 years ago

Thanks for reporting this issue and for the fix. I have integrated it and it will be part of DescTools 0.99.45, which will be published soon.