default alphas to 1.0

This commit is contained in:
Simon Christ 2021-05-12 10:21:22 +02:00
parent 61f2d825b6
commit cae7c8b965
3 changed files with 10024 additions and 1 deletions

View File

@ -1679,9 +1679,13 @@ function _update_series_attributes!(plotattributes::AKW, plt::Plot, sp::Subplot)
# update alphas # update alphas
for asym in (:linealpha, :markeralpha, :fillalpha) for asym in (:linealpha, :markeralpha, :fillalpha)
if plotattributes[asym] === nothing if plotattributes[asym] === nothing
if plotattributes[:seriesalpha] === nothing
plotattributes[asym] = plotattributes[:seriesalpha] = 1.0
else
plotattributes[asym] = plotattributes[:seriesalpha] plotattributes[asym] = plotattributes[:seriesalpha]
end end
end end
end
if plotattributes[:markerstrokealpha] === nothing if plotattributes[:markerstrokealpha] === nothing
plotattributes[:markerstrokealpha] = plotattributes[:markeralpha] plotattributes[:markerstrokealpha] = plotattributes[:markeralpha]
end end

10011
surface.tex Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,13 @@
using Plots, Test using Plots, Test
@testset "Default colors and alphas" begin
t = range(0, 3π, length = 100)
@test surface(t, t, (x, y) -> x * sin(x) - y * cos(y))[1][1][:seriesalpha] !== nothing
@test surface(t, t, (x, y) -> x * sin(x) - y * cos(y))[1][1][:fillalpha] !== nothing
@test plot(t, t)[1][1][:fillalpha] !== nothing
@test plot(t, t)[1][1][:seriesalpha] !== nothing
end
const PLOTS_DEFAULTS = Dict(:theme => :wong2) const PLOTS_DEFAULTS = Dict(:theme => :wong2)
Plots.__init__() Plots.__init__()