Re: [Risolto] TikZ e matrici

#67137
Liverpool
Partecipante
    Up
    0
    Down
    ::


    Che ne dici di questa modifica al tuo codice?
    `
    \documentclass{article}
    \usepackage{tikz}
    \usetikzlibrary{matrix,backgrounds}
    \begin{document}
    \begin{tikzpicture}
    \tikzset{mycolor/.style = {opacity=.4,line width=4 mm,line cap=round,color=#1}}
    \matrix[matrix of math nodes,left delimiter=(,right delimiter=)]
    {
    \node(a) {0}; & \node{1}; & \node {0}; &\node {0};\\
    \node {0}; & \node{1}; & \node {1}; &\node {1};\\
    \node(c) {1}; & \node{1}; & \node {1}; &\node (d){0};\\
    \node(b) {0}; & \node{1}; & \node {0}; &\node {0};\\
    };

    \begin{pgfonlayer}{background}
    \draw[mycolor=red!45] (a.north)–(b.south);
    \draw[mycolor=red!45] (c.west)–(d.east);
    \end{pgfonlayer}
    \end{tikzpicture}
    \end{document}`
    N.B.: richiede \usetikzlibrary{backgrounds} nel preambolo

    Ciao

    Go to top