Gaston: swap :image axes

This commit is contained in:
t-bltg 2021-08-03 17:54:49 +02:00 committed by GitHub
parent ed7b6f7f64
commit 67f441f152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,13 +213,11 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
if st == :image if st == :image
z = reverse(Float32.(Gray.(z)), dims=1) # flip y axis z = reverse(Float32.(Gray.(z)), dims=1) # flip y axis
nr, nc = size(z) nr, nc = size(z)
lx = length(x) if (ly = length(y)) == 2 && ly != nr
if lx == 2 && lx != nr y = collect(range(y[1], y[2], length=nr))
x = collect(range(x[1], x[2], length=nr))
end end
ly = length(y) if (lx = length(x)) == 2 && lx != nc
if ly == 2 && ly != nc x = collect(range(x[1], x[2], length=nc))
y = collect(range(y[1], y[2], length=nc))
end end
elseif st == :heatmap elseif st == :heatmap
length(x) == size(z, 2) + 1 && (x = @view x[1:end-1]) length(x) == size(z, 2) + 1 && (x = @view x[1:end-1])