I have a rather long time series. For example, T = mx100. I can break this long series into m subplots. For example:
using Plots
# number of supblots
m=5
# Size of my time series
T = m*100
# Time
t_ = 1:T
t_ = reshape( t_ , 100,m)
# X time series
X = rand(Normal(0,1), T)
X = reshape( X, 100,m)
# Plot
plot(t_, X, fmt=:png , layout = (m,1))
I have a vector U of size T of many zeros and few ones. For example:
# Points
U = rand(Binomial(1,.3) , T )
U = [1:T U ]
I want to add to the previous plot, points just on the time axis where the 1’s in the U vector happen. If for example I had two ones at position 25 and 75, I can do this (here m=5) :
# Plot
plot(t_, X, fmt=:png , layout = (m,1), legend = false)
scatter!([25, 75 ], [0 , 0],color=:red, markersize=4)
Unfortunately, I cannot generalize to the general U case.
help!