如何解决使用 Plots.jl 将一组图绘制为子图
继续这个话题:How to create an arbitrary number of subplots in 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)
我收到错误:
MethodError: no method matching Plots.Plot{Plots.PlotlyBackend}(::Char,::Char,...)
Closest candidates are: Plots.Plot{Plots.PlotlyBackend}(::Any,::Any,::Any)
我错过了什么?
解决方法
您需要使用 plot
在最后一次 ...
调用中“splat”子图数组:
using Plots
plot_array = []
for i in 1:5
push!(plot_array,plot(rand(10)))
end
plot(plot_array...) # note the "..."
会产生类似的东西
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。