I have the following code that I don't like and generates an error:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\draw[red, thick] (0,0) --(6,0);
\draw[blue, thick] (5,0.2) -- (9,0.2);
\draw plot[smooth] coordinates {(0,0.6) (0.4,1) (1,0.4) (1.6,1.2) (2,1.4) (2.6,0.6) (3.4,1.8) (3.8,1.2) (4.4,1.2)(5,0.8) (5.4,0.4) (6,1) (6.6,2) (7,1.6) (7.4,1) (8.2,0.6) (9,0.4)};
\path[postaction={decorate}, decoration={markings, mark ={between positions 0.6 and 1 step 0.04 with {\fill[blue] circle[radius=0.08cm];}}}] plot[smooth] coordinates {(0,0.6) (0.4,1) (1,0.4) (1.6,1.2) (2,1.4) (2.6,0.6) (3.4,1.8) (3.8,1.2) (4.4,1.2)(5,0.8) (5.4,0.4) (6,1) (6.6,2) (7,1.6) (7.4,1) (8.2,0.6) (9,0.4)};
\path[postaction={decorate}, decoration={markings, mark ={between positions 0 and 0.7 step 0.04 with {\fill[red] circle[radius=0.05cm];}}}] plot[smooth] coordinates {(0,0.6) (0.4,1) (1,0.4) (1.6,1.2) (2,1.4) (2.6,0.6) (3.4,1.8) (3.8,1.2) (4.4,1.2)(5,0.8) (5.4,0.4) (6,1) (6.6,2) (7,1.6) (7.4,1) (8.2,0.6) (9,0.4)};
\end{tikzpicture}
\end{document}
What I don't like is the repetition of the same commands, I am not sure how to streamline the code.
Second issue is that i get an error "Dimension too large" when compiling. I have googled the error but I could not really understand how the suggested solutions fit to my problem.
Any suggestion/pointer is very appreciated.

