我正在尝试重新创建该图表(在所见即所得的程序中绘制,并没有花费太多时间:
25cm 标签描述的是管道的高度(填充了不同类型的沙子/岩石)。8cm 描述的是管道的宽度。
这是我的 .tex...
\documentclass[12pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\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$};
\end{tikzpicture}
\end{document}
一旦我掌握了基础知识,我就想要有不同的图案(密集的点=细沙,间隔开的点=粗沙)并且不同部分的标签在右侧。
感谢您的帮助。
答案1
据我所知,需要声明新的模式才能调整密度等等。tikz-3dplot
允许您调整视角。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc,patterns}
\makeatletter
\newlength{\flex@pattern@density}
\newlength{\flex@pattern@linewidth}
\newlength{\flex@pattern@auxlength}
\newlength{\flex@pattern@auxlengthtwo}
\tikzset{/tikz/.cd,
pattern density/.code={\flex@pattern@density=#1
\flex@pattern@auxlength=1.1\flex@pattern@density
\flex@pattern@auxlengthtwo=\flex@pattern@density
\advance\flex@pattern@auxlengthtwo by 0.1pt
%\typeout{\the\flex@pattern@density,\the\flex@pattern@auxlength}
},
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}}%
{
\pgfsetcolor{\tikz@pattern@color}
\pgfpathcircle{\pgfqpoint{0pt}{0pt}}{\flex@pattern@linewidth}
\pgfusepath{fill}
}
\makeatother
\begin{document}
\tdplotsetmaincoords{100}{0}
\begin{tikzpicture}[tdplot_main_coords]
\pgfmathsetmacro{\R}{4}
\pgfmathsetmacro{\HW}{4}
\pgfmathsetmacro{\HC}{12}
% \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,
Fein/3.5/3,
MittelFein/5.5/4,
Aktivkohle/8/5,
MittelGrob/11/7,
Grob/12/9}
{%\typeout{\X,\Y,\LastY}
\draw[pattern=flexible dots,pattern density=\Z pt,pattern line width=0.4pt]
plot[variable=\x,domain=0:180,smooth]
({\R*cos(\x)},{\R*sin(\x)},\LastY) --
plot[variable=\x,domain=180:0,smooth]
({\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)},0)
--
plot[variable=\x,domain=180:360,smooth]
({\R*cos(\x)},{\R*sin(\x)},\HC) -- cycle;
\draw plot[variable=\x,domain=0:180,smooth]
({\R*cos(\x)},{\R*sin(\x)},\HC);
\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};
\end{tikzpicture}
\end{document}
答案2
也许这会给你一些绘画的方法
\documentclass[tikz,margin=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\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};
\end{tikzpicture}
\end{document}
答案3
经过一些调整后,我得到了这个.tex:
\documentclass[tikz,border=2pt,12pt]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[scale=0.15]
\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};
\end{tikzpicture}
\end{document}
我对最终的效果很满意。它紧凑而简洁。如果您对外观有什么建议,请分享!谢谢。