-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
support a y indexing different from x #4562
Conversation
@lmiq, I'm back so we can try to fix this. What would be conservative atm, and until we know more of the bug from We can always remove / rework that later. Something like: for i in firstindex(x):max(1, div(min(nsamples, length(x)), 2))
ii = i + yoffset
jj = j + yoffset
if checkbounds(Bool, x, i) && checkbounds(Bool, y, ii)
inv += inv(1 + weight * d_point(x[i], y[ii], lim, scale))
end
if checkbounds(Bool, x, j) && checkbounds(Bool, y, jj)
inv += inv(1 + weight * d_point(x[j], y[jj], lim, scale))
end
j -= 1
end |
It seems that he has a case where |
Wait, isn't that an effect of JuliaArrays/OffsetArrays.jl#77 ? We index series using a linear index, but they can be n-dimensional 🤔 Of course that assumes the bug occurring in julia> import OffsetArrays: Origin
julia> oa = zeros(10, 10) |> Origin(-4);
julia> firstindex(oa)
1
julia> firstindex(oa, 1)
-4
julia> firstindex(oa, 2)
-4 Anyway, until we have a Thanks for the reactivity. |
These plots fail, but not at the guessing of the legend position: julia> x = OffsetArray(rand(3,3), -2, -2);
julia> heatmap(x)
ERROR: BoundsError: attempt to access 3-element OffsetArrays.IdOffsetRange{Int64, Base.OneTo{Int64}} with indices -1:1 at index [2]
Stacktrace:
[1] throw_boundserror(A::OffsetArrays.IdOffsetRange{Int64, Base.OneTo{Int64}}, I::Tuple{Int64})
@ Base ./abstractarray.jl:703
[2] checkbounds
@ ./abstractarray.jl:668 [inlined]
[3] getindex
@ ~/.julia/packages/OffsetArrays/WvkHl/src/axes.jl:224 [inlined] |
Also, we didn't check EDIT: that might be it, since the error reported His error occurs on these types: x::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
y::Vector{Float64} |
Codecov ReportBase: 90.94% // Head: 90.95% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4562 +/- ##
=======================================
Coverage 90.94% 90.95%
=======================================
Files 40 40
Lines 7800 7803 +3
=======================================
+ Hits 7094 7097 +3
Misses 706 706
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
From what I tested, Plots errors much earlier if that is not true. |
@lmiq, remove draft & merge now ? |
Yeah, |
This change supports, in the
_guess_best_legend_position
function, different offsets for y and x. Aiming to address #4561.However, it seems that GR does not support those different offsets, thus the bug must be another.