feat!: Support matrix data with units#5623
Conversation
| argument_dims(::ImageLike, x, y, z) = (1, 2, 3) | ||
| argument_dims(::VertexGrid, x, y, z) = (1, 2, 3) # contour, contourf | ||
| argument_dims(::CellGrid, x, y, z) = (1, 2, 3) |
There was a problem hiding this comment.
With this, the heatmap/image/etc. data will be forced¹ to synchronize with other plots that map to dim 3. E.g. if you add a z component to scatter, that will have to synchronize. (You can use z values for ordering/layering in Axis.) Or if you plot multiple heatmaps.
Is that something we want? Or don't want? Or don't care about?
¹ Breaking also added force_dimconverts as a plot kwarg which can be set to false to allow unitless data to pass through. So it's not entirely forced, but still what happens by default
There was a problem hiding this comment.
Oh cool, force_dimconverts is a really nice escape hatch:
fig = Figure()
ax = Axis3(fig[1, 1])
scatter!(ax, 1:3, 1:3, (4:6)u"cm")
heatmap!(ax, 1:3, 1:3, rand(3, 3); force_dimconverts = false)
figWould adding a unit-aware method for transform! be feasible too? Then, being able to do something like this seems intuitive to me:
fig = Figure()
ax = Axis3(fig[1, 1])
scatter!(ax, 1:3, 1:3, (4:6)u"cm")
heatmap!(ax, 1:3, 1:3, rand(3, 3); transformation = (:xy, 5u"cm"), force_dimconverts = false)
figI'm still exploring the internals, but it seems like more invasive changes would need to be made if we were to go with implementing a totally separate color dim convert instead of just re-using the machinery that's already in place, so I feel inclined to just stick with the above design decision and document the force_dimconverts option for folks that need it.
I rarely if ever work in 3D, so apologies if I am missing other common use cases where this might be a problem.
Description
Follow-up to https://discourse.julialang.org/t/juliahub-raises-65m-series-b-and-launches-dyad-3-0/136941/20
Allows for things like this to work now:
Changes listed here: https://github.com/icweaver/Makie.jl/blob/units-matrix/CHANGELOG.md#unreleased
Would something like this make sense to add? At any rate, thanks all for the exciting developments that are going into v0.25 and beyond!
Type of change
Checklist
formatanduse_short_unitsfor DQ