2323scatter (f:: Array , options= Dict ()) = {" type" => " scatter" ," mode" => " markers" , " x" => [1 : length (f)], " y" => f}
2424line (f:: Array , options= Dict ()) = {" type" => " scatter" ," mode" => " lines" , " x" => [1 : length (f)], " y" => f}
2525box (f:: Array , options= Dict ()) = {" type" => " box" , " x" => [1 : length (f)], " y" => f}
26- histogram (f:: Array , options= Dict ()) = {" type" => " histogram" , " x" => [1 : length (f)], " y" => f}
26+ histogram (f:: Array , options= Dict ()) = {" type" => " histogram" , " y" => [1 : length (f)], " x" => f}
27+ bar (f:: Array , options= Dict ()) = {" type" => " bar" , " x" => [1 : length (f)], " y" => f}
2728
2829scatter (f:: Dict , options= Dict ()) = {" type" => " scatter" ," mode" => " markers" , " x" => [k for k in keys (f)], " y" => [v for v in Base. values (f)]}
2930line (f:: Dict , options= Dict ()) = {" type" => " scatter" ," mode" => " lines" , " x" => [k for k in keys (f)], " y" => [v for v in Base. values (f)]}
3031box (f:: Dict , options= Dict ()) = {" type" => " box" , " x" => [k for k in keys (f)], " y" => [v for v in Base. values (f)]}
3132histogram (f:: Dict , options= Dict ()) = {" type" => " histogram" , " x" => [k for k in keys (f)], " y" => [v for v in Base. values (f)]}
33+ bar (f:: Dict , options= Dict ()) = {" type" => " bar" , " x" => [k for k in keys (f)], " y" => [v for v in Base. values (f)]}
3234
3335scatter (f:: Function , options= Dict ()) = get_points (f, merge ({" type" => " scatter" ," mode" => " markers" }, options))
3436line (f:: Function , options= Dict ()) = get_points (f, merge ({" type" => " scatter" ," mode" => " lines" }, options))
3537box (f:: Function , options= Dict ()) = get_points (f, merge ({" type" => " box" }, options))
3638histogram (f:: Function , options= Dict ()) = get_points (f, merge ({" type" => " histogram" }, options))
39+ bar (f:: Function , options= Dict ()) = get_points (f, merge ({" type" => " bar" }, options))
3740
3841plot (f:: Function , options= Dict ()) = plot ([line (f, options)])
3942plot (fs:: Array{Function,1} , options= Dict ()) = plot ([line (f, options) for f in fs])
@@ -45,6 +48,7 @@ if Pkg.installed("Polynomial") !== nothing
4548 line (p:: Poly , options= Dict ()) = line (x-> polyval (p,x), options)
4649 box (p:: Poly , options= Dict ()) = box (x-> polyval (p,x), options)
4750 histogram (p:: Poly , options= Dict ()) = histogram (x-> polyval (p,x), options)
51+ bar (p:: Poly , options= Dict ()) = bar (x-> polyval (p,x), options)
4852
4953 function plot {T<:Number} (ps:: Array{Poly{T},1} , options= Dict ())
5054 data = [get_points (x-> polyval (p,x), merge ({" name" => " $p " }, options)) for p in ps]
@@ -67,6 +71,7 @@ if Pkg.installed("TimeSeries") !== nothing
6771 line (ts:: TimeArray , options= Dict ()) = [merge (x,{" type" => " line" ," mode" => " lines" }) for x in scatter (ts)]
6872 box (ts:: TimeArray , options= Dict ()) = [merge (x,{" type" => " box" }) for x in scatter (ts)]
6973 histogram (ts:: TimeArray , options= Dict ()) = [merge (x,{" type" => " histogram" }) for x in scatter (ts)]
74+ bar (ts:: TimeArray , options= Dict ()) = [merge (x,{" type" => " bar" }) for x in scatter (ts)]
7075 plot (ts:: TimeArray , options= Dict ()) = plot ([line (ts)], options)
7176end
7277
@@ -81,6 +86,7 @@ if Pkg.installed("WAV") !== nothing
8186 scatter {T<:Number,U<:Number,V<:Number} (wav:: (Array{T,2},U,V,UnionType) , options= Dict ()) = merge (line (wav),{" type" => " scatter" ," mode" => " markers" })
8287 box {T<:Number,U<:Number,V<:Number} (wav:: (Array{T,2},U,V,UnionType) , options= Dict ()) = merge (line (wav),{" type" => " box" })
8388 histogram {T<:Number,U<:Number,V<:Number} (wav:: (Array{T,2},U,V,UnionType) , options= Dict ()) = merge (line (wav),{" type" => " histogram" })
89+ bar {T<:Number,U<:Number,V<:Number} (wav:: (Array{T,2},U,V,UnionType) , options= Dict ()) = merge (line (wav),{" type" => " bar" })
8490
8591 function plot {T<:Number,U<:Number,V<:Number} (wav:: (Array{T,2},U,V,UnionType) , options= Dict ())
8692 opt = merge ({" layout" => {" xaxis" => {" title" => " seconds" ," dtick" => 1 ," tick0" => 0 ," autotick" => false }}}, options)
@@ -95,6 +101,7 @@ if Pkg.installed("DataFrames") !== nothing
95101 line (df:: DataFrame , options= Dict ()) = get_points (df, merge ({" type" => " scatter" ," mode" => " lines" }, options))
96102 box (df:: DataFrame , options= Dict ()) = get_points (df, merge ({" type" => " box" }, options))
97103 histogram (df:: DataFrame , options= Dict ()) = get_points (df, merge ({" type" => " histogram" }, options))
104+ bar (df:: DataFrame , options= Dict ()) = get_points (df, merge ({" type" => " bar" }, options))
98105 function get_points (df:: DataFrame , options= Dict ())
99106 default = {" type" => " scatter" , " mode" => " lines" }
100107 opt = merge (default, options)
0 commit comments