%% 
%%  A DANTE-Edition example
%% 
%%  Example 36-00-104 on page 812.
%% 
%%  Copyright (C) 2011 Herbert Voss
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 
%% 
%% ==== 
% Show page(s) 1
%% 
\documentclass[]{article}
\pagestyle{empty}
\setlength\textwidth{201.70511pt}
\setlength\parindent{0pt}

\usepackage{pst-plot}

\begin{document}
\newlength\xPos\newlength\XPos
\pspicture(0,-5)(10,5)
\psforeach{\xA}{0,1,1,0,1,0}{%
  \advance\XPos by 8mm\psTextFrame(\xPos,0)(\XPos,5mm){\xA}%
  \advance\xPos by 8mm}
\psline[linecolor=red]
  (0,-0.1)(0.8,-0.1)(0.8,2.2)(2.4,2.2)(2.4,-0.1)(3.2,-0.1)%
  (3.2,2.2)(4,2.2)(4,-0.1)(4.8,-0.1)
\pstVerb{usertime srand}
\pscustom[linecolor=blue,plotpoints=20]{
  \psplot{0}{0.8}{-3.3 Rand 3 mul add}
  \psplot[plotpoints=40]{0.8}{2.4}{-2 Rand 3 mul add}
  \psplot{2.4}{3.2}{-3.3 Rand 3 mul add}
  \psplot{3.2}{4}{-2 Rand 3 mul add}
  \psplot{4}{4.8}{-3.3 Rand 3 mul add}
}
\endpspicture
\end{document}
