I would like to get a plot like the one I sketched below, basically two blocks of the same matrix with arrows going up and anti-diagonally for the red block and arrows going up for the green one. The dots in the middle of the green one means to repeat the same pattern …. And I have as starting point the TikZ code below but I am not sure which would be the easiest way to do … I struggle still to get conditions in the for loops of TikZ with the complicated markup.

As starting point I have this including a commented attempt to create the upper triangular effect omitting the arrows for elements below the diagonal but can't get this code to work.

```
\begin{figure}[!h]
\centering
\begin{tikzpicture}[scale=1.5]
\clip (-0.3,-1.3) rectangle (8.3,4.3);
% \foreach \x in {0,...,8} {
% \foreach \y [evaluate=\y as \z using int(4-\y)] in {0,...,4} {
% \pgfmathtruncatemacro{\myresult}{\x<\z ? 1 : 0}
% \ifnum\myresult=0%
% \node at (\x cm,\y cm) (g-\x-\y) {$a_{\x,\z}$};\fi
% }
% }
\foreach \x in {0,...,8} {
\foreach \y [evaluate=\y as \z using int(4-\y)] in {0,...,4} {
\node at (\x cm,\y cm) (g-\x-\y) {$a_{\x,\z}$};
}
}
% vertical dependency
\foreach \x in {0,...,8} {
\foreach \y in {0,...,3} {
\draw[->,shorten <=2pt,shorten >=7pt] (g-\x-\y) -- +(0,20pt);
}
}
% horizontal
\foreach \x in {0,...,7} {
\foreach \y in {0,...,4} {
\draw[<-,shorten >=2pt,shorten >=7pt] (g-\x-\y) -- +(20pt,0);
}
}
% diagonal
\foreach \x in {1,...,8} {
\foreach \y in {0,...,3} {
\draw[->] (\x-.3,\y+.3) -- (\x - .6, \y+.6);
}
}
\end{tikzpicture}
\caption{Triangularize}
\label{fig:triangularize1}
\end{figure}
```

and the generated image in this case is (but actually I dont need the horizontal arrows):

## Best Answer

Maybe I took it a little too literal.

Mostly stolen from

Simulating hand-drawn lines

TikZ marking several blocks in a matrix

and for the font

CTAN font catalogue