我想在使用 GR 后端的 julia Plots 绘制的图中注释一个点。 我用 绘制箭头
plot([(pos1), (pos2)], line=:arrow)
正如预期的那样,这会绘制一个 :simple
箭头。
但是,我不知道如何获取 :filled
或 :close
箭头。
我尝试了几种排列:
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
是 magic argument并且 line = :arrow
将在预处理管道期间在内部转换为 arrow = :arrow
,覆盖提供的箭头属性。
plot(rand(2), rand(2), arrow = :closed, lims = (0, 1))
给出
关于julia - 在 Julia.Plots 中使用 GR 箭头样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60529422/