MakieLayout.jl icon indicating copy to clipboard operation
MakieLayout.jl copied to clipboard

Common convenience functions with AbstractPlotting

Open Tokazama opened this issue 5 years ago • 6 comments

This came up in reference with this recent PR to AbstractPlotting.jl. There are a number of functions here that would be nice for users to have consistent interface. For the ticks methods I did you could probably just have a per axis method for setting tick labels and rotations (xticks!, yticks!, zticks!, xtickrotation!, etc.).

Tokazama avatar Jan 27 '20 19:01 Tokazama

I'm not sure if I want additional functions that double what the attributes themselves are already doing. But what I find useful is bundling typical steps together. For example, when rotating x labels, usually the alignment has to be changed, so I find it useful to bundle that behavior in one function. Rotate ticks and set alignment. I would call that something like rotatedxticks!

jkrumbiegel avatar Jan 31 '20 17:01 jkrumbiegel

Or the whole interface has to be moved to functions. But neither redundancy nor a mixture is particularly appealing

jkrumbiegel avatar Jan 31 '20 17:01 jkrumbiegel

Functions are useful for user facing API because there isn't a need to learn the layout of every structure in the plotting ecosystem.

Tokazama avatar Jan 31 '20 19:01 Tokazama

Do you need to learn the structure of LAxis to do axis.xlabel = "my label"? I actually find it quite useful in editors that support suggesting propertynames, because in Atom for example I see all the available attributes already when I type axis.. Of course there are some attributes that are not directly represented, such as xlimits, but for those it's easy to add functions.

jkrumbiegel avatar Feb 02 '20 09:02 jkrumbiegel

Right now users have to do two different things to change the axis label for a Scene and LAxis. If property names is the best way of interfacing with what is produced by plotting functions that's fine, but it's better for users if there is a consistent interface. It's typically easier to use common methods than property names for an ecosystem that has different structure layouts.

BTW. I'm not trying to force anything into your package. You've done great work. I'm just trying to make it so people like me that are less skilled have a lower barrier to contributing and creating plots. If I'm totally going down the wrong path I'd be happy to rework what I've done in AbstractPlotting.jl accordingly.

Tokazama avatar Feb 02 '20 13:02 Tokazama

I get where you're coming from, I think a consistent user interface is very important, too. My work on MakieLayout has shown me, though, where AbstractPlotting is lacking, or what should probably be redesigned in order to correctly incorporate all the layouting functionality. Right now, I'm not really concerned that the way to change labels differs between Scene and LAxis because I think it's wrong for Scene to have labels at all, the lines between Scene, Axis and Plots are too blurry. In my redesign the scene should lose all its "axis-ness" and leave that to actual axis objects, of which my LAxis is the basic 2D version. So I don't really want to spend time on aspects that are going to change anyway, if you get what I mean. I'm trying to build the raw functionality and demonstrate it in a way that it convinces people it's the way to go in the future. So I'll keep your input in mind for later, but right now I won't spend much time on polishing this part of the package.

jkrumbiegel avatar Feb 02 '20 18:02 jkrumbiegel