DimensionalData.jl
DimensionalData.jl copied to clipboard
Different plots when using `Observable`
Hello,
The axes are not permuted and reordered when plotting Observable{DimArray} creating different plots when using Observable. Also, the axes label are not displayed.
using DimensionalData, CairoMakie
dimarray = rand(Y(3), X(7))
fig, ax, plt = series(dimarray)
series(fig[1,2], Observable(dimarray))
Probably related with #724
I didn't know that dispatch was even a thing in Makie, doesn't it need to be series! ? We are modifying an existing object...
This might be a dispatch that I did not catch in #743. Does this with a normal array?
Can you try an Axis as first argument?
series! would require a axis. series creates an axis in fig[1,2]
As far as I am aware, the code I posted above is equivalent to:
using DimensionalData, CairoMakie
dimarray = rand(Y(3), X(7))
fig, ax, plt = series(dimarray)
ax2 = Axis(fig[1,2])
series!(ax2, Observable(dimarray))
fig
Yes, it does work with a normal array both using series and series! (not sure if this is what you were asking):
array = rand(3, 7)
fig, ax, plt = series(array)
ax2 = Axis(fig[1,2])
series!(ax2, Observable(array))
fig
I'm saying series without ! may work, but it shouldn't ;)
Also wondering if this is a Makie bug.
@asinghvi17 should Makie conversions always happen to the contents of an observable too?
Yes always, if they don't it's because we override the plot functions...
Yes always, if they don't it's because we override the plot functions...
The problem seems to be specific to series because with plot I get the same plot from an Observable and from a plain DimArray. The only thing is, that the plot! function does not add the labels, because they are set on the Axis I think. But the dimension lookup is used.
With the Observable it is using a fallback method in MakieCore and takes the dimarray as a normal array.
With the Observable it is using a fallback method in MakieCore and takes the dimarray as a normal array.
This should never be the case. I wonder if we're missing a convert for series...