Skip to content

Commit

Permalink
fix Array constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
daschw committed Aug 10, 2018
1 parent 29cbfcb commit 397919b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/colors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ticks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 397919b

Please sign in to comment.