## TikZ

The code:

\documentclass[12pt]{article}

\usepackage{subfig}

\usepackage{tikz}

\usetikzlibrary{arrows.meta}

\usetikzlibrary{decorations.pathreplacing,decorations.markings}

\begin{document}

\begin{figure}

\begin{center}

\subfloat[LTR-TTB]{%

\begin{tikzpicture}

\node (A) at (-0.2,2) {a};

\node (B) at (3.2,2) {b};

\node (C) at (-0.2,1) {c};

\node (D) at (3.2,1) {d};

\node (E) at (-0.2,0) {e};

\node (F) at (3.2,0) {f};

\node (G) at (0.5,0) {o};

\node (H) at (1,0) {o};

\node (I) at (1.5,0) {o};

\node (J) at (2,0) {o};

\node (K) at (2.5,0) {o};

\node (L) at (0.5,1) {o};

\node (M) at (1,1) {o};

\node (N) at (1.5,1) {o};

\node (O) at (2,1) {o};

\node (P) at (2.5,1) {o};

\node (Q) at (0.5,2) {o};

\node (R) at (1,2) {o};

\node (S) at (1.5,2) {o};

\node (T) at (2,2) {o};

\node (U) at (2.5,2) {o};

\draw[

-{Latex[scale=1.5]},

% style between={(3,2)}{0,1}{red,dashed,thick},

% style between={5}{6}{green,very thick},

thick,

rounded corners=1.5em

] (0,2) |- (3,2) -- (0,1) -- (3,1) -- (0,0) -- (3,0);

% ] (A) |- (B) -- (C)[left] -- (D) -- (E) -- (F);

% \draw[thick,rounded corners=8pt] (0,2) |- (2,2) coordinate (x);

% \draw[-{Latex[scale=1.5]},blue,thick,dashed, rounded corners=8pt] (x) -- (0,1) ;

\end{tikzpicture}

%\end{center}

%\caption{LTR scanning path}

%\end{figure}

%\begin{figure}[hb]

%\begin{center}

\subfloat[RTL-TTB]{%

\begin{tikzpicture}

\node (A) at (3.2,2) {a};

\node (B) at (-0.2,2) {b};

\node (C) at (3.2,1) {c};

\node (D) at (-0.2,1) {d};

\node (E) at (3.2,0) {e};

\node (F) at (-0.2,0) {f};

\node (G) at (0.5,0) {o};

\node (H) at (1,0) {o};

\node (I) at (1.5,0) {o};

\node (J) at (2,0) {o};

\node (K) at (2.5,0) {o};

\node (L) at (0.5,1) {o};

\node (M) at (1,1) {o};

\node (N) at (1.5,1) {o};

\node (O) at (2,1) {o};

\node (P) at (2.5,1) {o};

\node (Q) at (0.5,2) {o};

\node (R) at (1,2) {o};

\node (S) at (1.5,2) {o};

\node (T) at (2,2) {o};

\node (U) at (2.5,2) {o};

\draw[

-{Latex[scale=1.5]},

thick,

rounded corners=1.5em

] (3,2) |- (0,2) -- (3,1) -- (0,1) -- (3,0) -- (0,0);

\end{tikzpicture}

} \\

%\end{center}

%\caption{RTL scanning path}

%\end{figure}

\subfloat[TTB-LTR]{%

%\begin{figure}

%\begin{center}

\begin{tikzpicture}

\node (A) at (0,3.2) {a};

\node (B) at (0,-0.2) {b};

\node (C) at (1,3.2) {c};

\node (D) at (1,-0.2) {d};

\node (E) at (2,3.2) {e};

\node (F) at (2,-0.2) {f};

\node (G) at (0,0.5) {o};

\node (H) at (0,1) {o};

\node (I) at (0,1.5) {o};

\node (J) at (0,2) {o};

\node (K) at (0,2.5) {o};

\node (L) at (1,0.5) {o};

\node (M) at (1,1) {o};

\node (N) at (1,1.5) {o};

\node (O) at (1,2) {o};

\node (P) at (1,2.5) {o};

\node (Q) at (2,0.5) {o};

\node (R) at (2,1) {o};

\node (S) at (2,1.5) {o};

\node (T) at (2,2) {o};

\node (U) at (2,2.5) {o};

\draw[

-{Latex[scale=1.5]},

thick,

rounded corners=1.5em

] (0,3) |- (0,0) -- (1,3) -- (1,0) -- (2,3) -- (2,0);

\end{tikzpicture}

%\end{center}

%\caption{TTB-LTR scanning path}

%\end{figure}

\subfloat[TTB-RTL]{%

%\begin{figure}

%\begin{center}

\begin{tikzpicture}

\node (A) at (0,3.2) {e};

\node (B) at (0,-0.2) {f};

\node (C) at (1,3.2) {c};

\node (D) at (1,-0.2) {d};

\node (E) at (2,3.2) {a};

\node (F) at (2,-0.2) {b};

\node (G) at (0,0.5) {o};

\node (H) at (0,1) {o};

\node (I) at (0,1.5) {o};

\node (J) at (0,2) {o};

\node (K) at (0,2.5) {o};

\node (L) at (1,0.5) {o};

\node (M) at (1,1) {o};

\node (N) at (1,1.5) {o};

\node (O) at (1,2) {o};

\node (P) at (1,2.5) {o};

\node (Q) at (2,0.5) {o};

\node (R) at (2,1) {o};

\node (S) at (2,1.5) {o};

\node (T) at (2,2) {o};

\node (U) at (2,2.5) {o};

\draw[

-{Latex[scale=1.5]},

thick,

rounded corners=1.5em

] (2,3) |- (2,0) -- (1,3) -- (1,0) -- (0,3) -- (0,0);

\end{tikzpicture}

}%end subfloat

\end{center}

\end{document}