专栏
标签
Plots画图问题
一般问题
发布于 2025-02-25 10:51:54
查看 18过去489天

using Plots
gr()
w = 0:0.01:2π;
x = 0.468 * cos.(0.5 * w);
y = 0.468 * sin.(0.5 * w);
x1 = cos(35.3 * π / 180);
y1 = sin(35.3 * π / 180);

Plots.plot(aspect_ratio=:equal, legend=false, xlim=(-1, 1), ylim=(0, 1));
plot!([0, x1], [0, y1], label="35.3° Line");
plot!([0, x], [0, y], label="R=0.468 Curve");
plot!([0, 0], [0, 1], linestyle=:dash, label="Vertical Line");
plot!([-1, 1], [0, 0], linestyle=:dash, label="Horizontal Line");

title!("Polar Plot");
xlabel!("Real Axis");
ylabel!("Imaginary Axis");

annotate!(0.5, 0.6, Plots.text("R=0.468", :left));
annotate!(0.5, 0.5, Plots.text("WT=1.232*0.5", :left));
以上代码出现如下问题:
ERROR: InitError: could not load library "C:\Users\Public\TongYuan.julia\artifacts\14c036187f02f2def7e45b19b27ea5d4a5873e21\bin\Qt5Concurrent.dll"
The specified procedure could not be found.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:117
[2] dlopen(s::String, flags::UInt32)
@ Base.Libc.Libdl .\libdl.jl:116
[3] macro expansion
@ C:\Users\Public\TongYuan.julia\packages\JLLWrappers\GfYNv\src\products\library_generators.jl:63 [inlined]
[4] init()
@ Qt5Base_jll C:\Users\Public\TongYuan.julia\packages\Qt5Base_jll\RCHuc\src\wrappers\x86_64-w64-mingw32-cxx11.jl:23
[5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1115
[6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base .\loading.jl:1061
[7] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})
@ Base .\loading.jl:1391
[8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base .\loading.jl:1494
[9] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1783
[10] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[11] macro expansion
@ .\loading.jl:1648 [inlined]
[12] macro expansion
@ .\lock.jl:267 [inlined]
[13] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[14] eval
@ .\boot.jl:370 [inlined]
[15] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1903
[16] include_string(m::Module, txt::String, fname::String)
@ Base .\loading.jl:1913
[17] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\essentials.jl:819
[18] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:816
[19] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:261
[20] (::VSCodeServer.var"#80#84"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:162
[21] withpath(f::VSCodeServer.var"#80#84"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\repl.jl:260
[22] (::VSCodeServer.var"#79#83"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:159
[23] hideprompt(f::VSCodeServer.var"#79#83"{Bool, Bool, Bool, Module, String,
Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\repl.jl:38
[24] (::VSCodeServer.var"#78#82"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:130
[25] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging .\logging.jl:514
[26] with_logger
@ .\logging.jl:626 [inlined]
[27] (::VSCodeServer.var"#77#81"{VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:253
[28] #invokelatest#2
@ .\essentials.jl:819 [inlined]
[29] invokelatest(::Any)
@ Base .\essentials.jl:816
[30] macro expansion
@ c:\Users\Public\TongYuan.syslab-oss\extensions\tongyuan.syslab-julia-0.9.16\scripts\packages\VSCodeServer\src\eval.jl:36 [inlined]
[31] (::VSCodeServer.var"#75#76")()
@ VSCodeServer .\task.jl:514
during initialization of module Qt5Base_jll

julia> 正在运行 Untitled-1.jl
WARNING: using Plots.plot in module Main conflicts with an existing identifier.
请问如何解决

所属专栏:Julia语言
产品信息:Syslab科学计算环境
科学计算控制工程

全部回答 1

发布于 2025-02-25 14:00:07

您好,Plots库与现有Syslab环境可能存在不兼容的情况,建议您使用TyPlot库进行绘制。

用户
和原帖交流更多问题细节吧,去
我要发帖 我要发帖
资料中心 资料中心
查看更多>
热门帖子 热门帖子
主要贡献者 主要贡献者
过去7天