Jen*_*Hsu 3 subplot julia plots.jl
该线程的延续:如何在 Julia Plots 中创建任意数量的子图
当我尝试时
using Plots
plot_array = Any[]
for i in 1:5
push!(plot_array, plot(rand(10))) # make a plot and add it to the plot_array
end
plot(plot_array)
Run Code Online (Sandbox Code Playgroud)
我收到错误:
MethodError: no method matching Plots.Plot{Plots.PlotlyBackend}(::Char, ::Char, ::Char, ::Char, ...)
Closest candidates are: Plots.Plot{Plots.PlotlyBackend}(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any)
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
plot
您需要使用以下命令在最后一次调用中“展开”子图数组...
:
using Plots
plot_array = []
for i in 1:5
push!(plot_array, plot(rand(10)))
end
plot(plot_array...) # note the "..."
Run Code Online (Sandbox Code Playgroud)
会产生类似的东西