
答案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}