Is it possible to add noise to the following function, which is piecewise constant?
Data:
time energy
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 1.8
12 1.8
13 1.8
14 1.8
15 1.8
16 0.8
17 0.8
18 0.8
19 0.8
20 0.8
21 0.8
22 0.8
23 0.8
24 0.8
25 0.3
26 0.3
27 0.3
28 0.3
29 0.3
30 0.3
31 0.3
32 0.3
33 0.3
34 0.3
36 0.3
37 0.3
38 0.3
39 0.3
40 0.3
41 0.3
42 0.3
43 0.3
44 0.3
45 0.3
46 0.3
Code:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=newest}
\begin{document}
\pgfplotstableread
{energy.dat}
{\table}
\begin{tikzpicture}
\begin{axis}[
ymin=0,
minor tick num=4,
enlarge x limits=false,
axis on top,
every axis plot post/.append style=
{mark=none},
const plot,
legend style={
area legend,
at={(0.5,-0.15)},
anchor=north,
legend columns=-1}]
\addplot[draw=blue,fill=blue!30!white]
table[x=time,y=energy] from \table
\closedcycle;
\legend{energy}
\end{axis}
\end{tikzpicture}
\end{document}
