Skip to content

Commit

Permalink
Fix Issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
haberdashPI committed Jul 23, 2019
1 parent 8227033 commit 23ef6ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PlotAxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function asplotable(x::AxisArray,ax1,axes...;
vals = PlotAxes.quantize(x,steps)
axqvals = PlotAxes.quantize.(axisvalues(x),steps)

df = DataFrame(value = vec(vals))
df = DataFrame(value = convert(Array{eltype(vals)},vec(vals)))
for ax in show_axes
axi = findfirst(isequal(axarg_name(ax)),axisnames(x))
df[!,ax] .= default_value(eltype(axqvals[axi]))
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ end
data = AxisArray(rand(10),Axis{:time}(range(0u"s",1u"s",length=10)))
df, = PlotAxes.asplotable(data,quantize=(5,))
@test size(df,1) == 5
@test df.time isa Array

df, = PlotAxes.asplotable(data,quantize=(20,))
@test size(df,1) == length(data)
@test df.time isa Array

df, = PlotAxes.asplotable(rand(10,10),quantize=(5,5))
@test size(df,1) == 25
Expand Down

0 comments on commit 23ef6ad

Please sign in to comment.