It worked! Apologies if it looked like I was blaming the package. I’m new to Julia and in the community maybe I chose the wrong tags. Thank you very much for your help.
Here, you need a .+ when adding a scalar to a vector, like 0.2cos.(2t .+ π), or as suggested by @tomerarnon, use @. 0.2cos(2t + π). Also note, there is no space after function names cos ( or between 0.2 cos. Finally, range can be written shorter as below.
using Plots
t = range(0, 10, length=100) # 0:0.01:2π
y = 0.2cos.(2t .+ π)
plot(t, y, label="cos(x)")
plot!(xlab="Time (s)", ylab="Distance (m)")
@. inserts a dot between all operators and function calls. If you are new to Julia, using the help system will be useful. Just start julia and enter ?@. and press enter.