在多个朱莉娅图上绘制垂直/水平线

发布于 2025-02-12 04:27:54 字数 559 浏览 3 评论 0原文

我试图用水平/垂直线的不同排列制作几个朱莉娅图:

using Plots


plot_array = Any[]
v_array = [1, 3]
h_array = [9, 10]

push!(variogram_array, plot([1, 2, 3, 4, 5], [1, 4, 9, 16, 25]))
push!(variogram_array, plot([1, 2, 3, 4, 5], [1, 16, 10, 15, 23]))

for i in 1:length(plot_array)
    display(plot(variogram_array..., size = (1000,1000)))
    plot!([v_array[i]], seriestype="vline",label= "rand",line=(:dot, 7))
    plot!([h_array[i]], seriestype="hline",label= "rand",line=(:dot, 7))
end

此代码输出主图,但不包括我需要的水平和垂直线。

有什么方法可以解决这个问题吗?我应该使用情节吗?

I was trying to make several Julia graphs with different arrangements of horizontal/vertical lines:

using Plots


plot_array = Any[]
v_array = [1, 3]
h_array = [9, 10]

push!(variogram_array, plot([1, 2, 3, 4, 5], [1, 4, 9, 16, 25]))
push!(variogram_array, plot([1, 2, 3, 4, 5], [1, 16, 10, 15, 23]))

for i in 1:length(plot_array)
    display(plot(variogram_array..., size = (1000,1000)))
    plot!([v_array[i]], seriestype="vline",label= "rand",line=(:dot, 7))
    plot!([h_array[i]], seriestype="hline",label= "rand",line=(:dot, 7))
end

This code outputs the main graphs, but doesn't include the horizontal and vertical lines as I need it to.

Is there any way to remedy this? Should I be using Plotly instead?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云巢 2025-02-19 04:27:54

改变情节!功能到Vline!和Hline!并在添加线路后显示显示两条图:

for i in 1:length(variogram_array)
    plt = plot(variogram_array..., size = (1000,1000))
    vline!([v_array[i]], label= "rand",line=(:dot, 7))
    hline!([h_array[i]], label= "rand",line=(:dot, 7))
    display(plt)
end

Changing the plot! function to vline! and hline! and displaying after the lines are added shows the two plots with lines:

for i in 1:length(variogram_array)
    plt = plot(variogram_array..., size = (1000,1000))
    vline!([v_array[i]], label= "rand",line=(:dot, 7))
    hline!([h_array[i]], label= "rand",line=(:dot, 7))
    display(plt)
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文