Edit and compile if you like:
\documentclass{standalone}%Drawing\usepackage{tikz}\tikzset{>=latex}\usetikzlibrary{calc}%Notation\usepackage{physics}% Colors\definecolor{blue1}{rgb}{0.0, 0.33, 0.71}\definecolor{blue2}{rgb}{0.29, 0.59, 0.82}%Newcommand%Newcommand%%Midline Label\newcommand{\midlinelabel}[3]%{\node (midlabel) at ($ (#1)!0.52!(#2) $) {#3};\draw[<-,thick] (#1) -- (midlabel);\draw[->,thick] (midlabel) -- (#2);}\begin{document}\begin{tikzpicture}% Grid% \draw[line width = 0.05] (0,0) grid (12,12);% Bottom Rectangle\draw[line width = 2, blue1, fill = blue2!40] (3,1) rectangle (11,3);% Upper Rectangle\draw[shift = {(0,4)}, line width = 2, blue1, fill = blue2!40] (3,1) rectangle (11,3);% Gray Lines%% Bottom\draw[line width = 1.5, black!40, ->] (3.8,2) -- +(1,0);\draw[line width = 1, black!40, dashed] (5,1) -- +(0,2);
Click to download: rod-oscillation.tex
Open in Overleaf: rod-oscillation.tex
This file is available on GitHub.
See more on the author page of Alexandros Tsagkaropolulos.