Skip to content

Commit

Permalink
Merge pull request #1186 from bjarthur/bja/uint32
Browse files Browse the repository at this point in the history
permit more than 256 discrete levels
  • Loading branch information
bjarthur authored Aug 28, 2018
2 parents e7a1b32 + 46e854f commit f8ec8ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ function trim_zip(xs...)
end

# Convenience constructors of IndirectArrays
discretize_make_ia(values::AbstractVector, levels) =
IndirectArray(Array{UInt8}(indexin(values, levels)), levels)
discretize_make_ia(values::AbstractVector, levels) = IndirectArray(indexin(values, levels), levels)
discretize_make_ia(values::AbstractVector) = discretize_make_ia(values, unique(values))
discretize_make_ia(values::AbstractVector, ::Void) = discretize_make_ia(values)

Expand Down
5 changes: 5 additions & 0 deletions test/testscripts/levels.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Gadfly

n=16
pts = repeat(1:n,inner=(1,n))
plot(x=pts, y=pts', color=string.(1:n*n), Theme(key_position=:none))

0 comments on commit f8ec8ff

Please sign in to comment.