Merge branch 'bbs/test' of github.com:BeastyBlacksmith/Plots.jl into bbs/test

This commit is contained in:
Simon Christ 2022-03-23 16:11:07 +01:00
commit 81a26f4140
2 changed files with 11 additions and 18 deletions

View File

@ -669,26 +669,18 @@ function axis_limits(
else else
end end
end end
if RecipesPipeline.is3d(:sp) if RecipesPipeline.is3d(:sp) && consider_aspect == true
xs = sp[1][:x] x12, y12, z12 = extrema(sp, :x), extrema(sp, :y), extrema(sp, :z)
ys = sp[1][:y] d = maximum((x12[2] - x12[1], y12[2] - y12[1], z12[2] - z12[1])) / 2
zs = sp[1][:z] amin, amax = if letter == :x
x12, y12, z12 = extrema(xs), extrema(ys), extrema(zs) xm = mean(x12)
d = maximum([diff([x12...]),diff([y12...]),diff([z12...])])[1] / 2 xm-d, xm+d
xm, ym, zm = mean(x12), mean(y12), mean(z12)
amin = if letter == :x
xm-d
elseif letter == :y elseif letter == :y
ym-d ym = mean(y12)
ym-d, ym+d
elseif letter ==:z elseif letter ==:z
zm-d zm = mean(z12)
end zm-d, zm+d
amax = if letter == :x
xm+d
elseif letter == :y
ym+d
elseif letter ==:z
zm+d
end end
end end
return amin, amax return amin, amax

View File

@ -43,6 +43,7 @@ mutable struct Subplot{T<:AbstractBackend} <: AbstractLayout
end end
Base.show(io::IO, sp::Subplot) = print(io, "Subplot{$(sp[:subplot_index])}") Base.show(io::IO, sp::Subplot) = print(io, "Subplot{$(sp[:subplot_index])}")
Base.extrema(sp::Subplot, letter::Symbol) = minimum(minimum.(getindex.(sp.series_list, letter))), maximum(maximum.(getindex.(sp.series_list, letter)))
# ----------------------------------------------------------- # -----------------------------------------------------------