From add53e4dbca1af045f3f9d3f7095bacd2e1761d1 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Wed, 2 Sep 2015 19:09:15 -0400 Subject: [PATCH] working on org/docs/test --- src/Plots.jl | 3 ++- src/gadfly.jl | 2 +- src/plotter.jl | 4 +--- src/qwt.jl | 2 +- test/runtests.jl | 5 +++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index e63b2d80..d903ee82 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -13,6 +13,7 @@ export typealias AVec AbstractVector typealias AMat AbstractMatrix +abstract PlottingPackage const IMG_DIR = "$(ENV["HOME"])/.julia/v0.4/Plots/img/" @@ -21,7 +22,7 @@ const IMG_DIR = "$(ENV["HOME"])/.julia/v0.4/Plots/img/" type Plot o # the underlying object - plotter::Symbol + plotter::PlottingPackage xdata::Vector{AVec} ydata::Vector{AVec} end diff --git a/src/gadfly.jl b/src/gadfly.jl index 4c7506a0..1c70dea1 100644 --- a/src/gadfly.jl +++ b/src/gadfly.jl @@ -4,7 +4,7 @@ immutable GadflyPackage <: PlottingPackage end # newplot(pkg::QwtPackage) = Plot(Qwt.plot(zeros(0,0)), pkg, AVec[], AVec[]) -# plot(::QwtPackage, plt::Plot; kw...) = Qwt.oplot(plt.o; kw...) +# plot!(::GadflyPackage, plt::Plot; kw...) = Qwt.oplot(plt.o; kw...) # plot(::GadflyPackage, y; kw...) = Gadfly.plot(; x = 1:length(y), y = y, kw...) # plot(::GadflyPackage, x, y; kw...) = Gadfly.plot(; x = x, y = y, kw...) diff --git a/src/plotter.jl b/src/plotter.jl index 39ca6c5a..6f9cceec 100644 --- a/src/plotter.jl +++ b/src/plotter.jl @@ -8,10 +8,8 @@ using Requires # --------------------------------------------------------- -abstract PlottingPackage - -const AVAILABLE_PACKAGES = [:Qwt, :Gadfly] +const AVAILABLE_PACKAGES = [:qwt, :gadfly] const INITIALIZED_PACKAGES = Set{Symbol}() type CurrentPackage diff --git a/src/qwt.jl b/src/qwt.jl index 2920d964..f56a1d20 100644 --- a/src/qwt.jl +++ b/src/qwt.jl @@ -4,6 +4,6 @@ immutable QwtPackage <: PlottingPackage end newplot(pkg::QwtPackage) = Plot(Qwt.plot(zeros(0,0)), pkg, AVec[], AVec[]) -plot(::QwtPackage, plt::Plot; kw...) = Qwt.oplot(plt.o; kw...) +plot!(::QwtPackage, plt::Plot; kw...) = Qwt.oplot(plt.o; kw...) # subplot(::QwtPackage, args...; kw...) = Qwt.subplot(args...; kw...) # savepng(::QwtPackage, plt, fn::String, args...) = Qwt.savepng(plt, fn) diff --git a/test/runtests.jl b/test/runtests.jl index bab231d3..dd139101 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,13 +7,14 @@ using FactCheck facts("Qwt") do @fact plotter!(:qwt) --> nothing @fact plotter() --> Plots.QwtPackage() - @fact tpye(plot(1:10, show=false)) --> Plot + @fact typeof(plot(1:10, show=false)) --> Plot end facts("Gadfly") do @fact plotter!(:gadfly) --> nothing @fact plotter() --> Plots.GadflyPackage() - @fact tpye(plot(1:10, show=false)) --> Plot + @fact typeof(plot(1:10, show=false)) --> Plot end +FactCheck.exitstatus() end # module