I have tried this code to plot these two side by side.
Edited
using StatsBase, Plots
using Distributions
n= 21600
P = M = Vector{Int}(undef,n)
P[1] =100
for second in 2:n
toss = sample(["H","T"], Weights([0.5,0.5]))
M[second] = rand(Poisson(5),1)
if toss=="H"
P[second]=P[second-1]+M[second]
else
P[second]=P[second-1]-M[second]
end
end
plot1((P))
hline!([0])
plot2((P))
hline!([0])
plot(plot1, plot2, layout = (1, 2), legend = false)
This is my code. Getting error as
ArgumentError: invalid index: sec of type typeof(sec)
How to fix this?