Makie.jl
Makie.jl copied to clipboard
Add mixed coordinate spaces
Description
This pr is sort of a continuation of #1596 with the goal of adding mixed coordinate spaces. We have some example applications of this in Makie already: vlines, hlines, errorbar and friends.
My idea for this is to allow passing a tuple of symbols as space = (x_space, y_space[, ...]) and generate the appropriate matrices from it. Something like axis-spanning horizontal could then be done with
lines!(ax, [0, 1], [y, y], space = (:relative, :data))
(This already works in GLMakie)
Type of change
Delete options that do not apply:
- [x] New feature (non-breaking change which adds functionality)
Checklist
- [ ] Added an entry in NEWS.md (for new features and breaking changes)
- [ ] Added or changed relevant sections in the documentation
- [ ] Added unit tests for new algorithms, conversion methods, etc.
- [ ] Added reference image tests for new plotting functions, recipes, visual options, etc.
- [x] GLMakie
- [x] CairoMakie
- [x] WGLMakie
Compile Times benchmark
Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt.
using time
master: 9.43 < 9.51 > 9.61, 0.06+-
pr: 9.42 < 9.52 > 9.58, 0.06+-
speedup: 0.99 < 1.00 > 1.00, 0.00+-
median: +0.18% => invariant
This PR does not change the using time.
ttfp time
master 27.10 < 27.16 > 27.25, 0.05+-
pr 26.82 < 27.22 > 27.27, 0.16+-
speedup: 1.00 < 1.00 > 1.01, 0.01+-
median: +0.23% => invariant
This PR does not change the ttfp time.
Hm, this seems to break WGLMakie volume plots...
That's weird though, right? I don't know what the implementation is doing but any incorrect projection matrices should fail all plot types. And the old tests are not using split spaces anyway, so they should not be affected.
It would be cool to get this feature going soon, AlgebraOfGraphics users would benefit from first-class hlines, vlines, hspan and vspan plotting functions. That said, I would maybe advocate for making one plot type each for HLines, VLines, etc, so that theses can be passed correctly to AoG, and probably that makes giving them individual LegendElements easier, one vertical, one horizontal.