MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

[BUG] `WilkinsonTicks` reduces ticks to 2 no matter what #2861

Open Datseris opened 1 year ago

Datseris commented 1 year ago

MWE:

using CairoMakie

x = -17.5:0.5
y = @. 1.14x - 2

fig, ax = lines(x, y)
fig

image

And then do:

ax.xticks = WilkinsonTicks(8)
fig

image

No matter what number is given to WilkinsonTicks, the resulting plot will have only 2 ticks.

Datseris commented 1 year ago

Doing fig, ax = lines(x, y; axis = (xticks = WilkinsonTicks(8),)) changes nothing; also makes ticks only 2.

Datseris commented 1 year ago

It only works when I explicitly increase the k_min keyword argument to 6.

asinghvi17 commented 1 year ago

We could have k_max and k_min move with k_ideal?

Datseris commented 1 year ago

Sounds good, but still not sure why this doesn't work as is; isn't the initial min = 2 anyways? Why is the initial plot with more ticks?

asinghvi17 commented 1 year ago

The initial plot is using LinearTicks, which is probably why your plot is showing this discrepancy...