\pgfmathsetseed{\time}
\begin{tikzpicture}[scale=1.2]
    % Define a red color similar to Diagram 1, or use a standard one
    % \definecolor{myTubeRed}{RGB}{200,0,0} % Optional: if you want the exact red
    
    \draw[thick, myblue] (-4, -1.5) rectangle (4, 1.5);

    \draw[<->] (-4.5, -1.5) -- (-4.5, 1.5);
    \node[left] at (-4.5, 0) {$\rho$};

    \def\smallrectwidth{3.6}
    \def\smallrectheight{0.25}
    \def\pointspread{0.8}
    \newcommand{\pointsize}{0.04} 

    % First tube
    \begin{scope}[rotate=8, shift={(0, 0.6)}]
        % Changed line: Added fill, fill opacity, and changed draw color to black
        \draw[draw=myblack, fill=myred, fill opacity=0.1, thick] 
            (-\smallrectwidth, -\smallrectheight) rectangle (\smallrectwidth, \smallrectheight);
        % Points near left end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{-\smallrectwidth + \pointspread + \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }
        % Points near right end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{\smallrectwidth - \pointspread - \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }
    \end{scope}

    % Second tube
    \begin{scope}[rotate=-12, shift={(0, 0.2)}]
        % Changed line: Added fill, fill opacity, and changed draw color to black
        \draw[draw=myblack, fill=myred, fill opacity=0.1, thick] 
            (-\smallrectwidth, -\smallrectheight) rectangle (\smallrectwidth, \smallrectheight);
        % Points near left end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{-\smallrectwidth + \pointspread + \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }
        % Points near right end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{\smallrectwidth - \pointspread - \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }
    \end{scope}

    % Third tube
    \begin{scope}[rotate=13, shift={(0, -0.4)}]
        % Changed line: Added fill, fill opacity, and changed draw color to black
        \draw[draw=myblack, fill=myred, fill opacity=0.1, thick] 
            (-\smallrectwidth, -\smallrectheight) rectangle (\smallrectwidth, \smallrectheight);
        % Points near left end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{-\smallrectwidth + \pointspread + \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }
        % Points near right end
        \foreach \i in {1,...,3} {
            \pgfmathsetmacro{\x}{\smallrectwidth - \pointspread - \pointspread*rand}
            \pgfmathsetmacro{\y}{\smallrectheight*0.8*rand}
            \filldraw[fill=myyellow, draw=myblack, thick] (\x, \y) circle (\pointsize);
        }

        % Label for width
        \draw[<->] (\smallrectwidth + 0.1, -\smallrectheight) -- (\smallrectwidth + 0.1, \smallrectheight);
        \node[right] at (\smallrectwidth + 0.1, 0) {$\delta$};
    \end{scope}
\end{tikzpicture}
