Zigzag on a matrix diagonal
Possibly...
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage{fullpage,amsmath}
\usepackage{times}
\begin{document}
\begin{tikzpicture}[baseline=(A.center)]
\tikzset{BarreStyle/.style = {opacity=.3,line width=3 mm,line cap=round,color=#1}}
\matrix(A) [matrix of math nodes, left delimiter = {[}, right delimiter ={]}]
{ M_{11} &|[color = blue]| M_{12} & M_{13} &|[color = magenta]| M_{14} & M_{15} &|[color = red]| M_{16} \\
|[color = blue]|M_{21} & M_{22} & |[color = magenta]|M_{23} & M_{24} & |[color = red]|M_{25} & M_{26} \\
M_{31} & |[color = magenta]|M_{32} & M_{33} &|[color = red]| M_{34} & M_{35} &|[color = orange]| M_{36} \\
|[color = magenta]| M_{41} & M_{42} &|[color = red]| M_{43} & M_{44} &|[color = orange]| M_{45} & M_{46} \\
M_{51} & |[color = red]|M_{52} & M_{53} & |[color = orange]|M_{54} & M_{55} &|[color = olive]| M_{56} \\
|[color = red]|M_{61} & M_{62} &|[color = orange]| M_{63} & M_{64} &|[color = olive]| M_{65} & M_{66} \\
};
\path [fill=red, fill opacity=0.25,rounded corners=0.125cm]
(A-1-1.north west) \foreach \i in {1,...,6}{ |- (A-\i-\i.south east) }
\foreach \i in {5,...,1} { |- (A-\i-\i.north east) } -- cycle;
\end{tikzpicture}
\end{document}
What about this?
Code (only the changed parts):
\tikzset{BarreStyle/.style = {
opacity=.3,line width=6 mm,
line cap=round, line join=round,
color=#1, shorten >= -0.1ex, shorten <= -1ex}
}
[Same matrix definition]
\draw [BarreStyle=red] (A-1-1.center) to (A-1-2.center)
to (A-2-2.center)
to (A-2-3.center)
to (A-3-3.center)
to (A-3-4.center)
to (A-4-4.center)
to (A-4-5.center)
to (A-5-5.center)
to (A-5-6.center)
to (A-6-6.center);