Is there a keyword argument to tune the number of ticks?
How could this be done?
I usually use Plots with the GR backend.
Often the routine finds a good number for the ticks.
Sometimes, I’d like to tune it a bit, e.g. here:
I am not sure how to touch this.
It would be great if there would be a way to extend the implementation for ticks and not just overwrite everything brute force as with:
ticks = collect(0:0.2:1)
ticklabels = [ @sprintf("%5.1f",x) for x in ticks ]
plot(xticks=(ticks,ticklabels))
Two things:
It would be great if the number of ticks could take the length of the numbers into account. This implies knowledge of the font size and length of the axis as well as the number range to be ticked.
A quick fix would be a semi manual argument like plot(..., xticks = :fewer)
I run in to this a lot: many of my axes have too many y ticks on them (>6). Would love to have an axis option to set the number of ticks, usually to 4 or 5 instead.
I often end up simply halving the number with a line like below, but this doesn’t always keep the tick for 0.
p = plot(...)
plot!(p[2], yticks=yticks(p[2])[1][1:2:end])