Plots.jl gives me too few ticks with some backends, especially GR, which is now my favourite. MWE:
using Plots using StatPlots gr() # important x = linspace(0.2291313228541989, 0.3318750511155737, 100) plot(density(x)) # 1 or 2 ticks
I looked at the source for something like R’s
pretty, and came up with this solution:
plt = plot(density(x); xticks = optimize_ticks(extrema(x)...; k_min = 10))
which works, but is there anything simpler? In particular, being able to pass
k_min as an argument without saving
x and computing its extrema would be convenient.
edit: I forgot to mention that I wish to avoid specifying ticks manually. I just want more of them, but otherwise automated.