diff --git a/src/colors.jl b/src/colors.jl index 45bb5d3..737eead 100644 --- a/src/colors.jl +++ b/src/colors.jl @@ -21,7 +21,7 @@ plot_color(s::Symbol, α::Number) = (iscgrad_symbol(s) ? cgrad(s, alpha=α) : RG plot_color(grad::ColorGradient, α::Number) = cgrad(grad, alpha=α) function plot_color(cs::AbstractArray) - a = Array{RGBA{Float64}}(undef, size(cs)) + a = Array{RGBA{Float64}}(undef, size(cs)...) for i in eachindex(cs) a[i] = plot_color(cs[i]) end @@ -30,7 +30,7 @@ end # plot_color(cs::AbstractVector, α::Number) = RGBA{Float64}[plot_color(c,α) for c in cs] function plot_color(cs::AbstractArray, α::Number) - a = Array{RGBA{Float64}}(undef, size(cs)) + a = Array{RGBA{Float64}}(undef, size(cs)...) for i in eachindex(cs) a[i] = plot_color(cs[i], α) end @@ -49,7 +49,7 @@ end function plot_color(zs::AbstractArray{T}) where T<:Number grad = cgrad() zmin, zmax = extrema(zs[isfinite.(zs)]) - a = Array{RGBA{Float64}}(undef, size(zs)) + a = Array{RGBA{Float64}}(undef, size(zs)...) for i in eachindex(zs) a[i] = grad[(zs[i]-zmin)/(zmax-zmin)] end @@ -62,7 +62,7 @@ end # end function plot_color(zs::AbstractArray{T}, α::Number) where T<:Number cs = plot_color(zs) - a = Array{RGBA{Float64}}(undef, size(zs)) + a = Array{RGBA{Float64}}(undef, size(zs)...) for i in eachindex(zs) a[i] = RGBA{Float64}(convert(RGB, cs[i]), α) end diff --git a/src/ticks.jl b/src/ticks.jl index ce2621a..ae73568 100644 --- a/src/ticks.jl +++ b/src/ticks.jl @@ -106,7 +106,7 @@ function optimize_ticks_typed(x_min::T, x_max::T, extend_ticks, while r*stp * one_t <= x_min # Filter or expand ticks if extend_ticks - S = Array{typeof(1.0 * one_t)}(Int(3 * k)) + S = Array{typeof(1.0 * one_t)}(undef, Int(3 * k)) for i in 0:(3*k - 1) S[i+1] = (r + i - k) * tickspan end