gpt4 book ai didi

julia - 在 Julia.Plots 中使用 GR 箭头样式

转载 作者:行者123 更新时间:2023-12-04 10:28:31 26 4
gpt4 key购买 nike

我想在我使用 julia Plots 和 GR 后端绘制的图中注释一个点。
我得到了绘制的箭头

plot([(pos1), (pos2)], line=:arrow)

正如预期的那样,这绘制了一个 :simple箭。
但是,我不知道如何获得 :filled:closed箭头。
我尝试了几种排列:
plt1 = plot([(pos1), (pos2)], line=:arrow, arrow=arrow(:closed))
plt2 = plot([(pos1), (pos2)], line=:arrow, arrow=:closed)

而且还直接调用GR函数
plt3 = plot([(pos1), (pos2)], line=:arrow, arrow_style=arrow(:closed))
plt4 = plot([(pos1), (pos2)], line=:arrow, arrow=arrow_style(:closed))

有没有办法在 Julia.Plots 上切换箭头样式?

最佳答案

你只需要摆脱 line = :arrow关键字参数。 line在 Plots 中是 magic argumentline = :arrow将转换为 arrow = :arrow在预处理管道内部,覆盖提供的箭头属性。

plot(rand(2), rand(2), arrow = :closed, lims = (0, 1))



enter image description here

关于julia - 在 Julia.Plots 中使用 GR 箭头样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60529422/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com