From bb0b6e5d33438500d4559ef2390303e272fe89b1 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Wed, 21 Aug 2019 13:05:29 -0400 Subject: [PATCH] Vector{Any} --- src/plot.jl | 7 ++++--- src/series.jl | 2 +- src/types.jl | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plot.jl b/src/plot.jl index 644beb8d..84694902 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -53,7 +53,7 @@ function plot(args...; kw...) # create an empty Plot then process plt = Plot() # plt.user_attr = plotattributes - _plot!(plt, plotattributes, args) + _plot!(plt, plotattributes, Any[args...]) end # build a new plot from existing plots @@ -154,7 +154,7 @@ function plot!(plt::Plot, args...; kw...) plotattributes = KW(kw) preprocessArgs!(plotattributes) # merge!(plt.user_attr, plotattributes) - _plot!(plt, plotattributes, args) + _plot!(plt, plotattributes, Any[args...]) end # ------------------------------------------------------------------------------- @@ -162,9 +162,10 @@ end # this is the core plotting function. recursively apply recipes to build # a list of series KW dicts. # note: at entry, we only have those preprocessed args which were passed in... no default values yet -function _plot!(plt::Plot{T}, plotattributes::KW, args::Tuple) where {T} +function _plot!(plt::Plot{T}, plotattributes::KW, args::Vector{Any}) where {T} plotattributes[:plot_object] = plt + if !isempty(args) && !isdefined(Main, :StatsPlots) && first(split(string(typeof(args[1])), ".")) == "DataFrames" @warn("You're trying to plot a DataFrame, but this functionality is provided by StatsPlots") diff --git a/src/series.jl b/src/series.jl index f4bdb61d..8b37605e 100644 --- a/src/series.jl +++ b/src/series.jl @@ -143,7 +143,7 @@ struct SliceIt end rib = ribbons[mod1(i,mr)] di[:ribbon] = isa(rib, Function) ? map(rib, di[:x]) : rib - push!(series_list, RecipeData(di, ())) + push!(series_list, RecipeData(di, Any[])) end end nothing # don't add a series for the main block diff --git a/src/types.jl b/src/types.jl index 39c26a80..d5a8f6e6 100644 --- a/src/types.jl +++ b/src/types.jl @@ -30,10 +30,11 @@ attr!(series::Series, v, k::Symbol) = (series.plotattributes[k] = v) # ----------------------------------------------------------- # a single subplot +const StandardPad = Measures.Length{:mm,Float64} mutable struct Subplot{T<:AbstractBackend} <: AbstractLayout parent::AbstractLayout series_list::Vector{Series} # arguments for each series - minpad::Tuple # leftpad, toppad, rightpad, bottompad + minpad::Tuple{StandardPad,StandardPad,StandardPad,StandardPad} # leftpad, toppad, rightpad, bottompad bbox::BoundingBox # the canvas area which is available to this subplot plotarea::BoundingBox # the part where the data goes attr::KW # args specific to this subplot