using SingularSpectrumAnalysis, Plots
# generate some data
L = 20 # Window length
K = 100
N = K*L; # number of datapoints
t = 1:N; # Time vector
T = 20; # period of main oscillation
y = sin.(2pi/T*t); # Signal
y .+= (0.5sin.(2pi/T*4*t)).^2 # Add another frequency
e = 0.1randn(N); # Add some noise
yn = y+e;
# plot(ys)
yt, ys = analyze(yn, L, robust=true) # trend and seasonal components
plot(yt, lab="Trend")
plot!(ys, lab="Season")
could not load library “libGR.dll”
The specified module could not be found.
setcharheight(::Float64) at GR.jl:1395
gr_set_font(::Plots.Font, ::Plots.Subplot{Plots.GRBackend}; halign::Symbol, valign::Symbol, color::RGBA{Float64}, rotation::Int64) at gr.jl:386
(::Plots.var"#gr_set_font##kw")(::NamedTuple{(:halign, :valign, :rotation),Tuple{Symbol,Symbol,Int64}}, ::typeof(Plots.gr_set_font), ::Plots.Font, ::Plots.Subplot{Plots.GRBackend}) at gr.jl:385
gr_set_xticks_font(::Plots.Subplot{Plots.GRBackend}) at gr.jl:688
_update_min_padding!(::Plots.Subplot{Plots.GRBackend}) at gr.jl:900
iterate at generator.jl:47 [inlined]
_collect(::Array{AbstractLayout,2}, ::Base.Generator{Array{AbstractLayout,2},typeof(Plots._update_min_padding!)}, ::Base.EltypeUnknown, ::Base.HasShape{2}) at array.jl:678
collect_similar(::Array{AbstractLayout,2}, ::Base.Generator{Array{AbstractLayout,2},typeof(Plots._update_min_padding!)}) at array.jl:607
map(::Function, ::Array{AbstractLayout,2}) at abstractarray.jl:2072
_update_min_padding!(::Plots.GridLayout) at layouts.jl:310
prepare_output(::Plots.Plot{Plots.GRBackend}) at plot.jl:184
showjuno(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol(“image/svg+xml”)}, ::Plots.Plot{Plots.GRBackend}) at output.jl:258
show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol(“image/svg+xml”)}, ::Plots.Plot{Plots.GRBackend}) at output.jl:212
show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::String, ::Plots.Plot{Plots.GRBackend}) at multimedia.jl:109
displayinplotpane(::Plots.Plot{Plots.GRBackend}) at showdisplay.jl:67
displayandrender(::Plots.Plot{Plots.GRBackend}) at showdisplay.jl:131
(::Atom.var"#222#227")() at eval.jl:189
#invokelatest#1 at essentials.jl:712 [inlined]
invokelatest at essentials.jl:711 [inlined]
(::Atom.var"#220#225"{String,String})() at eval.jl:188
withpath(::Atom.var"#220#225"{String,String}, ::Nothing) at utils.jl:30
withpath(::Function, ::String) at eval.jl:9
#219 at eval.jl:171 [inlined]
with_logstate(::Atom.var"#219#224"{String,String}, ::Base.CoreLogging.LogState) at logging.jl:398
with_logger at logging.jl:505 [inlined]
#218 at eval.jl:170 [inlined]
hideprompt(::Atom.var"#218#223"{String,String}) at repl.jl:127
macro expansion at dynamic.jl:24 [inlined]
evalall(::String, ::Nothing, ::String) at eval.jl:160
invokelatest(::Any, ::Any, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at essentials.jl:712
invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at essentials.jl:711
macro expansion at eval.jl:41 [inlined]
(::Atom.var"#188#189")() at task.jl:358
There may be a problem with my “Plots” Pkg, how should we resolve it?thanks!