Declarative ylims!

f = draw(layers)
ylims!(f.grid[1,1].axis, -.4, .4)

Is there a declarative way to set the axis limits using the draw function?

usually it’s axis = (limits = (xmin, xmax, ymin, ymax),) but I’m not sure if AoG would overwrite that

1 Like

This works:

axis = (; limits=(nothing, (-0.4, 0.4)))

f = draw(layers; axis)

After #204 there shouldn’t be any explicit keyword arguments that are overridden by AoG, so that should just work.

This does not seem to work for me.

fig = data(@where(dat, :orient.==1, :rand_seed_world.==111)) * 
    (visual(BoxPlot) + visual(Scatter)) *
    mapping(:expl, :n_arrived, col=(:err => string), row=(:link_thresh => string), color=:social, dodge=:social)

d = draw(fig; axis=(;limit=(nothing, (7000, 10000))))

No matter which value I insert for the y limits the plot always displays the full range of the data (~ 0-10k).

Just a typo of writing limit instead of limits?

:man_facepalming: Ouch, you are completely right.

To be fair, we are aware that it’s not very user friendly to silently ignore misspelled keyword arguments, and are thinking about ways to improve this.


That would indeed be quite helpful. Plus some documentation on which keywords are supported would be great. IIUC this exposes Makie’s API (correct me if I’m wrong), so maybe just a pointer to the corresponding section in the Makie docs?

?Axis gives a whole long list, limits is in there as well.

1 Like

Cool, thanks.