GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 250 forks source link

Axes labels should continue to be redrawn as zoom level increases #1435

Open robsmith11 opened 4 years ago

robsmith11 commented 4 years ago

If I create a simple plot like:

plot(DataFrame(x=1:100, y=rand(100)), x=:x,y=:y, Geom.point)

it opens in my browser I can zoom in nicely with Shift-Mouse Drag, but the axes labels will be only drawn to granularity of 5 on the x-axes and 0.05 on the y-axes. If I zoom in enough on a few points, there won't be any axes labels remaining at all.

Would it be possible to ensure that there is always a fixed number of axes labels on each axes shown at all zoom levels?

bjarthur commented 4 years ago

yea, this could be done a lot better. currently three zoom levels of ticks are hard coded. see https://github.com/GiovineItalia/Gadfly.jl/blob/2dfff47bb04274d5783d3a34fda12af053dec2e8/src/ticks.jl#L286-L287

robsmith11 commented 4 years ago

Ah I see. Ggplotly solves this by having a dynamicTicks options so that the labels can be computed dynamically with Javascript, but that takes a bit of logic to get the format and units right for different types, so not an easy fix.