Open Jonas-a-Zimmermann opened 1 month ago
A (naive) fix for this is to add the xlims and ylims in the cornerplot
, as e.g.
# scatters
for i = 1:N
vi = view(mat, :, i)
for j = 1:N
# only the lower triangle
if compact && i <= j
continue
end
vj = view(mat, :, j)
@series begin
ticks := :auto
if i == N
xformatter := :auto
xguide := _cycle(labs, j)
end
if j == 1
yformatter := :auto
yguide := _cycle(labs, i)
end
seriestype := :scatter
subplot := indices[i + 1 - k, j]
markercolor := grad[0.5 + 0.5C[i, j]]
smooth --> true
markerstrokewidth --> 0
xlims --> extrema(vj).*1.05
ylims --> extrema(vi).*1.05
vj, vi
end
end
# end
end
leading to the desired outcome
After some digging I came to the conclusion that the cause of the issue is the usage of the depracted orientation
in the definition of the histogram series (to clarify: line 71 of cornerplot.jl). After changing it to permute
, it works as expected.
However, the histograms on the right corner suffer from the same issue as in https://github.com/JuliaPlots/Plots.jl/issues/4949 .
While it also suffers from #4949 , there is the more intricate and serious issue of expand_extrema
not fixing the lower limits of the (post permute)x-axis
. This is set during the bar
recipe. I believe the best course of action would be to just not handle axis widening during recipes
.
With expand_extrema!(axis, scale_lims(ignorenan_extrema(xseg.pts)..., default_widen_factor))
in the bar recipe
Without expand_extrema!(axis, scale_lims(ignorenan_extrema(xseg.pts)..., default_widen_factor))
in the bar recipe
Details
The y-lims in the cornerplot subfigures are too large, rendering the scatterplot and row-wise histograms useless. e.g.
leads to
Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version: Backend version: GR v0.73.8, PlotlyJS v0.18.14 Output of
versioninfo()
: Julia Version 1.10.5 Commit 6f3fdf7b362 (2024-08-27 14:19 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (arm64-apple-darwin22.4.0) CPU: 14 × Apple M3 Max WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)