首页 > 解决方案 > 使用 Julia 绘图时 GKS QtTerm 窗口没有响应

问题描述

这是我的代码:

using Plots
using Interact

function golfBall(xPos, gravity, angleInRadians, initialVelocity)
    num = -(xPos * xPos * gravity)
    cosTheta = cos(angleInRadians)
    den = 2 * initialVelocity * initialVelocity * cosTheta * cosTheta
    term1 = num/den
    term2 = xPos * tan(angleInRadians)
    return term1 + term2
end

@manipulate for theta=0:0.01:pi/2, g = 10, u = 25
    f(x) = golfBall(x, g, theta, u)
    gr(show = true)
    plt = plot(f, 0, 100)
    display(plt)
end

它在 Juno 的绘图窗格中运行良好。在 Juno 之外,会创建一个 GKS QtTerm 窗口,但无法打开或切换到该窗口。这不是@manipulate宏,甚至plot(rand(5), rand(5))在 REPL 中也不起作用

编辑:它现在可以工作了,并且显示了图表,但没有滑块或文本框。

标签: plotjuliajuno-ide

解决方案


推荐阅读