JuliaRobotics / KernelDensityEstimatePlotting.jl
Showing 1 of 3 files from the diff.
Other files ignored by Codecov
.travis.yml has changed.
Project.toml has changed.

@@ -312,10 +312,10 @@
Loading
312 312
313 313
# """
314 314
#     $(SIGNATURES)
315 -
#
316 -
# Standardize the length colors used by RoMEPlotting.
315 +
316 +
# Standardize the length colors used by RoMEPlotting, returns `::Vector{String}`.
317 317
# """
318 -
function getColorsByLength(len::Int=7)::Vector{String}
318 +
function getColorsByLength(len::Int=7)
319 319
  len > 99 ? error("Don't have enough colors, 100 is the max.") : nothing
320 320
  COLORS = String["red";"green";"blue";"magenta";"yellow";"deepskyblue"]
321 321
  if len > 6
@@ -331,20 +331,20 @@
Loading
331 331
# function to draw all pairs of mulitdimensional kernel density estimate
332 332
# axis is matrix with rows as dimensions and two columns for min and max axis cutoffs
333 333
function plotKDE(darr::Array{BallTreeDensity,1};
334 -
                 c::NothingUnion{Vector}=getColorsByLength(length(darr)), # nothing
334 +
                 c::NothingUnion{Vector{<:AbstractString}}=getColorsByLength(length(darr)), # nothing
335 335
                 N::Int=200,
336 336
                 rmax=-Inf,rmin=Inf,  # should be deprecated
337 337
                 axis::NothingUnion{Array{Float64,2}}=nothing,
338 338
                 dims::NothingUnion{VectorRange{Int}}=nothing,
339 -
                 xlbl::T="X", # to be deprecated
340 -
                 title::NothingUnion{T}=nothing,
341 -
                 legend::NothingUnion{Vector{T}}=nothing,
342 -
                 dimLbls::NothingUnion{Vector{T}}=nothing,
339 +
                 xlbl::AbstractString="X", # to be deprecated
340 +
                 title::NothingUnion{<:AbstractString}=nothing,
341 +
                 legend::NothingUnion{Vector{<:AbstractString}}=nothing,
342 +
                 dimLbls::NothingUnion{Vector{<:AbstractString}}=nothing,
343 343
                 levels::NothingUnion{Int}=nothing,
344 344
                 fill=false,
345 345
                 points::Bool=true,
346 346
                 layers::Bool=false,
347 -
                 overlay=nothing ) where {T <: AbstractString}
347 +
                 overlay=nothing )
348 348
    #
349 349
    # defaults
350 350
    defaultcolor = false
@@ -353,7 +353,16 @@
Loading
353 353
      defaultcolor = true
354 354
    end
355 355
    # c = (length(c)>=2) ? c : repeat(c,length(darr))
356 -
    lg = (legend == nothing) ? nothing : Guide.manual_color_key("Legend", legend, c)
356 +
    lg = if (legend == nothing)
357 +
      nothing
358 +
    else
359 +
      thecolors = Vector{Colorant}()
360 +
      for eachcol in parse.(Colorant, c)
361 +
        push!(thecolors, eachcol)
362 +
      end
363 +
      @show thecolors
364 +
      Guide.manual_color_key("Legend", legend, thecolors)
365 +
    end
357 366
358 367
    H = nothing
359 368
    i = 0
Files Coverage
src/KernelDensityEstimatePlotting.jl 71.43%
Project Totals (1 files) 71.43%