diff --git a/src/Plots.jl b/src/Plots.jl index 05f3f6d0..8f419e40 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -5,6 +5,7 @@ module Plots using Reexport using FixedSizeArrays @reexport using RecipesBase +import RecipesBase: plot, animate using Base.Meta @reexport using PlotUtils @reexport using PlotThemes @@ -30,9 +31,6 @@ export with, twinx, - @userplot, - @shorthands, - pie, pie!, plot3d, @@ -156,16 +154,6 @@ include("backends.jl") # --------------------------------------------------------- -# define and export shorthand plotting method definitions -macro shorthands(funcname::Symbol) - funcname2 = Symbol(funcname, "!") - esc(quote - export $funcname, $funcname2 - $funcname(args...; kw...) = plot(args...; kw..., seriestype = $(quot(funcname))) - $funcname2(args...; kw...) = plot!(args...; kw..., seriestype = $(quot(funcname))) - end) -end - @shorthands scatter @shorthands bar @shorthands barh diff --git a/src/recipes.jl b/src/recipes.jl index 2da6ca60..2a44b6df 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1,53 +1,4 @@ - - -""" -You can easily define your own plotting recipes with convenience methods: - -``` -@userplot type GroupHist - args -end - -@recipe function f(gh::GroupHist) - # set some attributes, add some series, using gh.args as input -end - -# now you can plot like: -grouphist(rand(1000,4)) -``` -""" -macro userplot(expr) - _userplot(expr) -end - -function _userplot(expr::Expr) - if expr.head != :type - errror("Must call userplot on a type/immutable expression. Got: $expr") - end - - typename = expr.args[2] - funcname = Symbol(lowercase(string(typename))) - funcname2 = Symbol(funcname, "!") - - # return a code block with the type definition and convenience plotting methods - esc(quote - $expr - export $funcname, $funcname2 - $funcname(args...; kw...) = plot($typename(args); kw...) - $funcname2(args...; kw...) = plot!($typename(args); kw...) - end) -end - -function _userplot(sym::Symbol) - _userplot(:(type $sym - args - end)) -end - - -# ---------------------------------------------------------------------------------- - const _series_recipe_deps = Dict() function series_recipe_dependencies(st::Symbol, deps::Symbol...) @@ -96,7 +47,7 @@ end num_series(x::AMat) = size(x,2) num_series(x) = 1 -RecipesBase.apply_recipe{T}(d::KW, ::Type{T}, plt::Plot) = throw(MethodError("Unmatched plot recipe: $T")) +RecipesBase.apply_recipe{T}(d::KW, ::Type{T}, plt::AbstractPlot) = throw(MethodError("Unmatched plot recipe: $T")) # --------------------------------------------------------------------------- diff --git a/src/types.jl b/src/types.jl index 06ddb065..3e07587b 100644 --- a/src/types.jl +++ b/src/types.jl @@ -8,10 +8,6 @@ const KW = Dict{Symbol,Any} immutable PlotsDisplay <: Display end -abstract type AbstractBackend end -abstract type AbstractPlot{T<:AbstractBackend} end -abstract type AbstractLayout end - # ----------------------------------------------------------- immutable InputWrapper{T}