Vector{Any}
This commit is contained in:
parent
7185e36795
commit
bb0b6e5d33
@ -53,7 +53,7 @@ function plot(args...; kw...)
|
|||||||
# create an empty Plot then process
|
# create an empty Plot then process
|
||||||
plt = Plot()
|
plt = Plot()
|
||||||
# plt.user_attr = plotattributes
|
# plt.user_attr = plotattributes
|
||||||
_plot!(plt, plotattributes, args)
|
_plot!(plt, plotattributes, Any[args...])
|
||||||
end
|
end
|
||||||
|
|
||||||
# build a new plot from existing plots
|
# build a new plot from existing plots
|
||||||
@ -154,7 +154,7 @@ function plot!(plt::Plot, args...; kw...)
|
|||||||
plotattributes = KW(kw)
|
plotattributes = KW(kw)
|
||||||
preprocessArgs!(plotattributes)
|
preprocessArgs!(plotattributes)
|
||||||
# merge!(plt.user_attr, plotattributes)
|
# merge!(plt.user_attr, plotattributes)
|
||||||
_plot!(plt, plotattributes, args)
|
_plot!(plt, plotattributes, Any[args...])
|
||||||
end
|
end
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
@ -162,9 +162,10 @@ end
|
|||||||
# this is the core plotting function. recursively apply recipes to build
|
# this is the core plotting function. recursively apply recipes to build
|
||||||
# a list of series KW dicts.
|
# a list of series KW dicts.
|
||||||
# note: at entry, we only have those preprocessed args which were passed in... no default values yet
|
# 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
|
plotattributes[:plot_object] = plt
|
||||||
|
|
||||||
|
|
||||||
if !isempty(args) && !isdefined(Main, :StatsPlots) &&
|
if !isempty(args) && !isdefined(Main, :StatsPlots) &&
|
||||||
first(split(string(typeof(args[1])), ".")) == "DataFrames"
|
first(split(string(typeof(args[1])), ".")) == "DataFrames"
|
||||||
@warn("You're trying to plot a DataFrame, but this functionality is provided by StatsPlots")
|
@warn("You're trying to plot a DataFrame, but this functionality is provided by StatsPlots")
|
||||||
|
|||||||
@ -143,7 +143,7 @@ struct SliceIt end
|
|||||||
rib = ribbons[mod1(i,mr)]
|
rib = ribbons[mod1(i,mr)]
|
||||||
di[:ribbon] = isa(rib, Function) ? map(rib, di[:x]) : rib
|
di[:ribbon] = isa(rib, Function) ? map(rib, di[:x]) : rib
|
||||||
|
|
||||||
push!(series_list, RecipeData(di, ()))
|
push!(series_list, RecipeData(di, Any[]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
nothing # don't add a series for the main block
|
nothing # don't add a series for the main block
|
||||||
|
|||||||
@ -30,10 +30,11 @@ attr!(series::Series, v, k::Symbol) = (series.plotattributes[k] = v)
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
|
||||||
# a single subplot
|
# a single subplot
|
||||||
|
const StandardPad = Measures.Length{:mm,Float64}
|
||||||
mutable struct Subplot{T<:AbstractBackend} <: AbstractLayout
|
mutable struct Subplot{T<:AbstractBackend} <: AbstractLayout
|
||||||
parent::AbstractLayout
|
parent::AbstractLayout
|
||||||
series_list::Vector{Series} # arguments for each series
|
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
|
bbox::BoundingBox # the canvas area which is available to this subplot
|
||||||
plotarea::BoundingBox # the part where the data goes
|
plotarea::BoundingBox # the part where the data goes
|
||||||
attr::KW # args specific to this subplot
|
attr::KW # args specific to this subplot
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user