timbod7 / haskell-chart

A 2D charting library for haskell
429 stars 85 forks source link

Labels for log scale axis are not readable at all #214

Closed Shimuuar closed 1 year ago

Shimuuar commented 4 years ago

It's not the worst example but it's bad enough: badlog

Counting nines is not pleasant and if we go above/below 10^±15 labels could easily eat half of the plot. And whole 1+9999 thing looks very strange

clayrat commented 1 year ago

Oh, so this is actually pretty old. The example at https://github.com/timbod7/haskell-chart/wiki/example-4 has proper labels, after that the function showDs was introduced in 2016 which switches to offsets when there are duplicate tick values. The question is however why do we get duplicate tick values - this also leads to having 1 minor tick per interval instead of 9.

clayrat commented 1 year ago

Turns out it's unrelated after all - the minor ticks are generated by a heuristic, and the label issue can be just solved by nubbing the outputs of logTicks.