这是我要运行的代码
begin
for i in 1:10:100
display(Plots.plot(x[i:i+100]))
end
end
这是我得到的输出
Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}Plot{Plots.GRBackend() n=1}
我正在尝试获取一系列不同的图形,以显示在每个循环中指定的 x 的不同切片。有谁知道我怎样才能做到这一点?
最佳答案
比方说,如果您想要 5×2 网格中的图表,您可以执行以下操作:
[collect(row) for row in eachrow(reshape([Plots.plot(i:i+100) for i in 1:10:100], (5,:)))]
(我删除了 x
以避免 undefined variable 错误。)
这并不理想,所以希望有人能提出更好的解决方案。
关于plot - 为什么我的 Julia 脚本在 Pluto 中不显示情节?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74253795/