-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the generalized Arrays interface (OffsetArrays) #1259
Comments
I guess this can be fixed by using |
You guessed right! |
[EDIT] That PR is a step toward fixing the example below, but as noted there, does not yet fix Another example using Makie
using OffsetArrays
fig = Figure()
ax = Axis(fig[1, 1], title = "Demo")
heatmap!(ax, fill(0.0, (-10:10, -10:10))) gives this on the current release (does not include #1260)
|
Is this a regression at this point? |
I guess it's not a regression so much as it never worked correctly in the first place. I have a PR up for that but should restart discussion at some point. |
The heatmap example fails on master because fig
Error showing value of type Figure:
ERROR: MethodError: Cannot `convert` an object of type
OffsetMatrix{ColorTypes.RGBA{Float32}, Matrix{ColorTypes.RGBA{Float32}}} to an object of type
Union{ColorTypes.RGBA{Float32}, Matrix{ColorTypes.RGBA{Float32}}}
Closest candidates are:
convert(::Type{T}, ::T) where T
@ Base Base.jl:84
Stacktrace:
[1] numbers_to_colors(numbers::OffsetMatrix{…}, colormap::Vector{…}, colorscale::Function, colorrange::Vec{…}, lowclip::ColorTypes.RGBA{…}, highclip::ColorTypes.RGBA{…}, nan_color::ColorTypes.RGBA{…})
@ Makie ~/.julia/dev/Makie/src/colorsampler.jl:163
[2] to_color(c::Makie.ColorMapping{2, OffsetMatrix{Float32, Matrix{Float32}}, OffsetMatrix{Float32, Matrix{Float32}}})
@ Makie ~/.julia/dev/Makie/src/colorsampler.jl:346
[3] draw_atomic(scene::Scene, screen::CairoMakie.Screen{CairoMakie.IMAGE}, primitive::Union{Image, Heatmap})
@ CairoMakie ~/.julia/dev/Makie/CairoMakie/src/primitives.jl:805 |
Makie should be able to plot the generalized Arrays interface to be compatible with e.g. OffsetArrays.
Currently,
results in:
To plot this data we need to:
The text was updated successfully, but these errors were encountered: