Skip to main content

Live time series with confidence intervals

Let us assume a loop like below:

import numpy as np

ax = []; ay = []
for n in range(N):
    avgC = np.zeros(M)
    for m in range(M):
        ...
        Cost = aFuncation
        avgC[m] = Cost

    ax.append(n); ay.append(np.mean(avgC))

I would like to use ax and ay to plot a live time series which shows how np.mean(avgC) evolves over different iterations of n. At the same time, I would like to plot the confidence intervals according to avgC (a figure like below example).

enter image description here



source https://stackoverflow.com/questions/70825697/live-time-series-with-confidence-intervals

Comments