Is there a way to “automatically” nest layouts?
using RecipesBase
@recipe function f(pt::MyPlotType, arr::Array{<:MyDataType})
layout := GridLayout(size(arr)...)
for data in arr
@series begin
(data,)
end
end
end
@recipe function f(data::DataType1)
# makes one series
end
@recipe function f(data::DataType2)
# makes two series
end
so that plotting a 1x2 array of DataType1
would create a layout like @layout [a b]
whereas plotting a 1x2 array of DataType2
would create a layout like @layout [[a; b] [c; d]]