【问题标题】:How to increase point density in julia plots?如何增加朱莉娅地块中的点密度?
【发布时间】:2021-07-18 09:43:39
【问题描述】:

我正在绘制函数tan,但由于点密度在 Inf 值附近太低,因此渲染不干净。

using Plots
plot(x -> tan(x), 1, 10)

tan function

如何增加点密度?我在文档中没有看到它。

【问题讨论】:

    标签: plot julia


    【解决方案1】:

    我找到了语法: plot(x -> tan(x), 1:0.0001:10, ylims=(-20, 20)) 这样,x 轴从 1 变为 10,步长为 0.0001

    【讨论】:

    • 顺便说一句,x -> tan(x) 是多余的,你可以直接说tan
    【解决方案2】:

    最简单的方法就是明确指定x点的向量:

    using Plots
    x = 0:0.001:10
    plot(x, tan.(x), xlims=(0,10), ylims=(-1000,1000))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-27
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-31
      相关资源
      最近更新 更多