From 554d7ab88774583ce50cca677e6ee0fb94ce3541 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Mon, 1 May 2017 16:56:29 -0700 Subject: [PATCH 1/5] remove `@shorthands` --- src/Plots.jl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 05f3f6d0..35765a66 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -30,9 +30,6 @@ export with, twinx, - @userplot, - @shorthands, - pie, pie!, plot3d, @@ -156,16 +153,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 From 67e5598d28650064657c07edf0775e1aca14a2da Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 28 Apr 2017 22:43:23 -0700 Subject: [PATCH 2/5] Move the @userplot recipes https://github.com/JuliaPlots/RecipesBase.jl/pull/16 --- src/recipes.jl | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 2da6ca60..02221cac 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...) From 4770f8b58088fe7df6bbe03ca1f9df20dec691c2 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Mon, 1 May 2017 05:27:53 -0700 Subject: [PATCH 3/5] Merge remote-tracking branch 'ChrisRackauckas/master' into patch-1 --- src/Plots.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Plots.jl b/src/Plots.jl index 35765a66..da1c4513 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 using Base.Meta @reexport using PlotUtils @reexport using PlotThemes From ac505ede4419080cedfcbff20ed19470f498ea15 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Mon, 1 May 2017 06:27:37 -0700 Subject: [PATCH 4/5] move abstract types and make PlotRecipe on abstract type --- src/recipes.jl | 2 +- src/types.jl | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 02221cac..2a44b6df 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -47,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} From 0a8d3f92513fabdda9ff33fd0a78501f9f95a833 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Sun, 14 May 2017 13:26:50 -0700 Subject: [PATCH 5/5] animate from RecipesBase --- src/Plots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plots.jl b/src/Plots.jl index da1c4513..8f419e40 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -5,7 +5,7 @@ module Plots using Reexport using FixedSizeArrays @reexport using RecipesBase -import RecipesBase: plot +import RecipesBase: plot, animate using Base.Meta @reexport using PlotUtils @reexport using PlotThemes