Skip to content

Commit

Permalink
Merge pull request #42 from daschw/fix1.0
Browse files Browse the repository at this point in the history
fix plot_color error
  • Loading branch information
daschw authored Aug 10, 2018
2 parents 0f20716 + 397919b commit 4c8273f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/colors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 4c8273f

Please sign in to comment.