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

标签 julia annotate arrows

我想在使用 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 关键字参数即可。图中的 linemagic argument并且 line = :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/

相关文章:

haskell - 不使用 monadic bind 使用循环写下 mfix 的情况

callback - Julia 中的函数句柄

r - 在不同的上下文中, "vectorization"一词是否意味着不同的事物?

arrays - Julia :在二维数组中变换数组的数组

julia - 将字符串参数转换为正则表达式

django - 如何通过带注释的字段对组合查询集进行排序?

r - 注释ggplot条形图错误: Unused arguments

django - 如何用自创建以来的天数注释查询集

haskell - 箭头是功能的真正概括吗?

haskell - 链接类型为 `a b [c]` 和 `a c d` 的箭头