Open david-macmahon opened 3 weeks ago
Thanks for the issue. I can reproduce this. With one dimensional DimArrays it is not running into a stack overflow error, but it ignores the units and the values of the Dimension but it correctly uses the Dimension label for the axis label.
julia> ddu = DimArray(rand(3), (Dim{:freq}((1.0:0.5:2.0)u"Hz")))
╭───────────────────────────────╮
│ 3-element DimArray{Float64,1} │
├───────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────── dims ┐
↓ freq Sampled{Quantity{Float64, 𝐓^-1, Unitful.FreeUnits{(Hz,), 𝐓^-1, nothing}}} (1.0:0.5:2.0) Hz ForwardOrdered Regular Points
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
1.0 Hz 0.406088
1.5 Hz 0.834368
2.0 Hz 0.0332971
julia> plot(ddu)
I expect that this related to by #720.
[14] convert_arguments(::Type{Heatmap}, ::IntervalSets.ClosedInterval{Quantity{…}}, ::Vararg{Any}; kw::@Kwargs{})
This stuff is meant to be handled by expand_dimensions
, so implementing #720 may help here.
Ah right, really need #720!
I am super busy currently I'm unlikely to have time for it soon. So if anyone wants to try to for it
It only worked on 1-dim arrays because it ignored the lookup values of the axis with #714 I get the following error.
julia> plot(ddu)
ERROR: MethodError: no method matching convert_arguments(::PointBased, ::StepRange{Quantity{…}, Quantity{…}}, ::Vector{Float64})
Closest candidates are:
convert_arguments(::PointBased, ::AbstractVector{T} where T<:Number, ::AbstractVector{T} where T<:Number, ::AbstractVector{T} where T<:Number)
@ Makie ~/.julia/packages/Makie/iRM0c/src/conversions.jl:131
convert_arguments(::PointBased, ::AbstractArray, ::AbstractVector, ::AbstractArray)
@ Makie ~/.julia/packages/Makie/iRM0c/src/conversions.jl:112
convert_arguments(::PointBased, ::IntervalSets.ClosedInterval, ::AbstractVector{T} where T<:Number)
@ Makie ~/.julia/packages/Makie/iRM0c/src/conversions.jl:166
...
Stacktrace:
[1] convert_arguments(t::PointBased, A::DimVector{…})
@ DimensionalDataMakie ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:353
[2] _pointbased1(A::DimVector{…}, attributes::@Kwargs{}; set_axis_attributes::Bool)
@ DimensionalDataMakie ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:94
[3] _pointbased1
@ ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:89 [inlined]
[4] plot(A::DimVector{…}; axislegendkw::@NamedTuple{}, attributes::@Kwargs{})
@ DimensionalDataMakie ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:77
[5] plot(A::DimVector{…})
@ DimensionalDataMakie ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:76
[6] top-level scope
@ REPL[43]:1
Some type information was truncated. Use `show(err)` to see complete types.
Using
plot
to plot aDimArray
whose axes haveUnitful
units leads to aStackOverflowError
. If the axes do not have units then all is fine (except for no units).Version Info:
Minimum (non-)Working Example
Here is a simple test case showing this problem: