From f62b569560350102b42ffc97f9fe759509cf9b9d Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Mon, 5 Oct 2020 01:14:18 +0200 Subject: [PATCH] Fix #28 and similar issues --- src/Gnuplot.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 55a2581..51920d6 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -704,7 +704,7 @@ end function DatasetBin(cols::Vararg{AbstractVector, N}) where N source = "binary record=$(length(cols[1])) format='" types = Vector{DataType}() - (length(cols) == 1) && (source *= "%int") + #(length(cols) == 1) && (source *= "%int") for i in 1:length(cols) @assert length(cols[1]) == length(cols[i]) if isa(cols[i][1], Int32); push!(types, Int32); source *= "%int" @@ -721,7 +721,7 @@ function DatasetBin(cols::Vararg{AbstractVector, N}) where N (path, io) = mktemp() source = " '$path' $source" for row in 1:length(cols[1]) - (length(cols) == 1) && (write(io, convert(Int32, row))) + #(length(cols) == 1) && (write(io, convert(Int32, row))) for col in 1:length(cols) write(io, convert(types[col], cols[col][row])) end @@ -809,7 +809,7 @@ function useBinaryMethod(args...) elseif options.preferred_format == :auto if (length(args) == 1) && isa(args[1], AbstractMatrix) binary = true - elseif all(ndims.(args) .== 1) + elseif all(ndims.(args) .== 1) && all(eltype.(args) .<: Real) s = sum(length.(args)) if s > 1e4 binary = true