有没有办法在 Julia 中绘制布局,每个图使用不同的颜色?
我正在尝试使用下面的代码在 Julia env 中绘制布局
x = 1:100
y = sin.(rand((Normal()), 100,4))
# plot
plot(x,y)
# layout
plot(x,y, layout = (4,1), color = [:red,:blue])
我期望的是每个图的颜色为红色或蓝色。结果是 4 个图同时具有红色和蓝色。我缺少什么?
I am trying to plot a layout in Julia env using the code below
x = 1:100
y = sin.(rand((Normal()), 100,4))
# plot
plot(x,y)
# layout
plot(x,y, layout = (4,1), color = [:red,:blue])
What I expected was a coloring of each plot with either red or blue. The result was 4 plots that had both red and blue. What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是由于
color
的维度:有理由认为它将将此方案应用于原始数组的每 2 项。但是...
这将每两列应用一次。所以应该是这样的:
It is due to the dimension of
color
:It is reasonable to think it will apply this scheme to each 2 items of the original array. However...
this will be applied each 2 columns. So it should be as follows: