答案1
您可以调整宽度、高度、颜色等,希望这些键是不言自明的,无论如何它们在手册中都有详细记录。
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\path foreach \Y [evaluate=\Y as \Xmax using {int(3-\Y)}] in {0,...,3}
{foreach \X in {-\Xmax,...,\Xmax}
{(\X,\Y) node[cylinder,draw,fill=green!80!black,rotate=90,minimum
width=4mm,minimum height=7mm]{}}};
\end{tikzpicture}
\end{document}