I am trying to recreate this diagram (drawn in a WYSIWYG program and didn't spend a lot of time on it:

The 25cm label describes the height of the pipe (filled with different types of sand / rock). The 8cm describes the width of the pipe.

Here is my .tex ...

\begin{tikzpicture}[>=latex,shorten >=2pt,shorten <=2pt,shape aspect=1]

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw] (grob){Grob};

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw,below of= grob] (mittelgrob){MittelGrob};

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw=black,below of=mittelgrob] (Aktivkohle){Aktivkohle};

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw=black,below of=Aktivkohle] (mittelfein){MittelFein};

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw=black,below of=mittelfein] (fein){Fein};

\node [cylinder,shape border rotate=90,minimum height=1cm,minimum width=8cm,draw=black,below of=fein] (tuch){Tuch};

\draw [<->] (tuch) -- (tuch) node [midway, above,fill=white] {$8cm$};


which compiles to this PDF:

Once I get the basics, I want to have different patterns (dense dots=fine sand, spaced out dots=coarser sand) and the labels of the different parts be on the right.

Thanks for your help.


AFAIK one needs to declare new patterns to be able to adjust the density and so on. tikz-3dplot allows you to adjust the view angles.

    pattern density/.code={\flex@pattern@density=#1
    \advance\flex@pattern@auxlengthtwo by 0.1pt
    pattern density=3pt,
    pattern line width/.code={\flex@pattern@linewidth=#1},
    pattern line width=0.4pt,
\pgfdeclarepatternformonly[\flex@pattern@density,\flex@pattern@linewidth,\tikz@pattern@color]{flexible dots}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{1pt}{1pt}}{\pgfqpoint{\flex@pattern@density}{\flex@pattern@density}}%
  % \X=label, \Y=upper height in cm, \Z=distance between dots
  \foreach \X/\Y/\Z [remember=\Y as \LastY (initially 0)] in {Tuch/1.5/1,
     \draw[pattern=flexible dots,pattern density=\Z pt,pattern line width=0.4pt] 
     ({\R*cos(\x)},{\R*sin(\x)},\LastY) --
     ({\R*cos(\x)},{\R*sin(\x)},\Y) -- cycle;
     \node[anchor=west] at (\R,0,{(\Y+\LastY)/2}){\X};
  \draw plot[variable=\x,domain=0:180,smooth]
  ({\R*cos(\x)},{\R*sin(\x)},\HC) -- cycle;
  \draw plot[variable=\x,domain=0:180,smooth]
  \draw (-1.1*\R,0,0) -- (-1.1*\R,0,\HC) node[midway,sloped,above]{25cm};
  \draw (-\R,\R,0,-0.2) -- (\R,\R,-0.2) node[midway,sloped,below]{8cm};

enter image description here

  • 1
    Wow! I just noticed the 100k! Congrats! Well deserved! ;-) – gusbrs Feb 15 at 20:26
  • Thank you, @marmot. This is what I wanted. Now I just have to figure out how to implement the label lines (25cm and 8cm) with arrows. – Max R Feb 15 at 21:18
  • @MaxR You're welcome, I added some labels. JouleV.s nice answer has a nice way to add them (but here it is arguably advantageous to use 3d coordinates). – user121799 Feb 15 at 21:38

Maybe this will give you some way to draw

\foreach \i in {0,10,16,20,22} { % Add y-coordinates
    \draw (0,\i) arc (360:180:8cm and 3cm);
    \draw[dashed] (0,\i) arc (0:180:8cm and 3cm);
\draw (0,25) arc (0:360:8cm and 3cm);
\draw (-16,0)--(-16,25) (0,0)--(0,25);
\draw (-17,0)--(-17,25) node[midway,above,rotate=90] {25 cm};
\draw (-16,-3.5)--(0,-3.5) node[midway,below] {8 cm};

enter image description here


After some more tweaking I got this .tex:


\foreach \i in {0,5,10,15,20,25,30} {
    \draw [thick] (0,\i) arc (360:180:6cm and 2cm);
    \draw[dashed,ultra thin] (0,\i) arc (0:180:6cm and 2cm);
\draw [thick](0,30) arc (0:360:6cm and 2cm);
\draw [thick](-12,0)--(-12,30) (0,0)--(0,30);
\draw [|{Stealth}-{Stealth}|](-13,0)--(-13,30) node[midway,above,rotate=90] {25 cm};
\draw [|{Stealth}-{Stealth}|](-12,-3)--(0,-3) node[midway,below] {8 cm};

\draw (0,0)--(0,5) node[midway,right] {vi};
\draw (0,5)--(0,10) node[midway,right] {v};
\draw (0,10)--(0,15) node[midway,right] {iv};
\draw (0,15)--(0,20) node[midway,right] {iii};
\draw (0,20)--(0,25) node[midway,right] {ii};
\draw (0,25)--(0,30) node[midway,right] {i};

which typesets to: Screenshot (the Roman numerals correspond to different items in the text)

I'm glad at how it turned out. It is compact and concise. If you have any tips for the appearance, please share! Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.