how to scale a tikz matrix?












0














I have the matrix:
enter image description here



which is obtained from the following code:



usetikzlibrary{patterns}
usetikzlibrary{matrix,decorations.pathreplacing,calc}


%opening
title{}
author{}


pgfkeys{tikz/mymatrixenv/.style={decoration={brace},every left delimiter/.style={xshift=8pt},every right delimiter/.style={xshift=-8pt}}}
pgfkeys{tikz/mymatrix/.style={matrix of math nodes,nodes in empty cells,left delimiter={[},right delimiter={]},inner sep=1pt,outer sep=1.5pt,column sep=8pt,row sep=8pt,nodes={minimum width=20pt,minimum height=10pt,anchor=center,inner sep=0pt,outer sep=0pt}}}
pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}

newcommand*mymatrixbraceright[4][m]{
draw[mymatrixbrace] (#1.west|-#1-#3-1.south west) -- node[left=2pt] {#4} (#1.west|-#1-#2-1.north west);
}
newcommand*mymatrixbraceleft[4][m]{
draw[mymatrixbrace] (#1.east|-#1-#2-1.north east) -- node[right=2pt] {#4} (#1.east|-#1-#2-1.south east);
}
newcommand*mymatrixbracetop[4][m]{
draw[mymatrixbrace] (#1.north-|#1-1-#2.north west) -- node[above=2pt] {#4} (#1.north-|#1-1-#3.north east);
}
newcommand*mymatrixbracebottom[4][m]{
draw[mymatrixbrace] (#1.south-|#1-1-#2.north east) -- node[below=2pt] {#4} (#1.south-|#1-1-#3.north west);
}


tikzset{style green/.style={
set fill color=green!50!lime!60,draw opacity=0.4,
set border color=green!50!lime!60,fill opacity=0.1,
},
style cyan/.style={
set fill color=cyan!90!blue!60, draw opacity=0.4,
set border color=blue!70!cyan!30,fill opacity=0.1,
},
style orange/.style={
set fill color=orange!90, draw opacity=0.8,
set border color=orange!90, fill opacity=0.3,
},
style brown/.style={
set fill color=brown!70!orange!40, draw opacity=0.4,
set border color=brown, fill opacity=0.3,
},
style purple/.style={
set fill color=violet!90!pink!20, draw opacity=0.5,
set border color=violet, fill opacity=0.3,
},
kwad/.style={
above left offset={-0.1,0.23},
below right offset={0.10,-0.36},
#1
},
pion/.style={
above left offset={-0.07,0.2},
below right offset={0.07,-0.32},
#1
},
poz/.style={
above left offset={-0.03,0.18},
below right offset={0.03,-0.3},
#1
}
}

[
% mathbf{X} =
begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]
matrix [mymatrix,inner sep=4pt] (m)
{
tikzmarkin[kwad=style green]{Prime} v_{1,1} & v_{1,2} & tikzmarkin[pion=style purple]{VL} v_{1,3} & textcolor{white}{v_{1,4}} & & textcolor{white}{v_{1,6}} \
v_{2,1} & v_{2,2} & v_{2,3} & & & \
tikzmarkin[poz=style brown]{HL} v_{3,1} & v_{3,2} & tikzmarkin[kwad=style orange]{Mix} v_{3,3} tikzmarkend{Prime} &tikzmarkin[pion=style purple]{VR} v_{3,4} tikzmarkend{HL} & & \
textcolor{white}{v_{4,1}} & & tikzmarkin[poz=style brown]{HR} v_{4,3} tikzmarkend{VL}& tikzmarkin[kwad=style cyan]{Bis} v_{4,4} tikzmarkend{Mix} & v_{4,5} & v_{4,6} tikzmarkend{HR} \
& & & v_{5,4} & v_{5,5} & v_{5,6} \
textcolor{white}{v_{6,1}} & & & v_{6,4} tikzmarkend{VR} & v_{6,5} & v_{6,6} tikzmarkend{Bis} \
};

% Braces
mymatrixbraceright{1}{3}{$B'$}
mymatrixbraceright{4}{6}{$B''$}
mymatrixbracetop{1}{3}{$C'$}
mymatrixbracetop{4}{6}{$C''$}
mymatrixbracebottom{3}{3}{$F'$}
mymatrixbracebottom{4}{4}{$F''$}
mymatrixbraceleft{3}{3}{$E'$}
mymatrixbraceleft{4}{4}{$E''$}
end{tikzpicture}
]


I was trying to change:



begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]


to



begin{tikzpicture}[scale=2,baseline={-0.5ex},mymatrixenv]


but without effect.



I also tryied this when I import the picture to another document:



begin{figure}
centering
scalebox{2}{
input{color_matrix3.tikz}
}
end{figure}


the output was indeed bigger but not centered and latex gave a lot of errors concerning math equations









share



























    0














    I have the matrix:
    enter image description here



    which is obtained from the following code:



    usetikzlibrary{patterns}
    usetikzlibrary{matrix,decorations.pathreplacing,calc}


    %opening
    title{}
    author{}


    pgfkeys{tikz/mymatrixenv/.style={decoration={brace},every left delimiter/.style={xshift=8pt},every right delimiter/.style={xshift=-8pt}}}
    pgfkeys{tikz/mymatrix/.style={matrix of math nodes,nodes in empty cells,left delimiter={[},right delimiter={]},inner sep=1pt,outer sep=1.5pt,column sep=8pt,row sep=8pt,nodes={minimum width=20pt,minimum height=10pt,anchor=center,inner sep=0pt,outer sep=0pt}}}
    pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}

    newcommand*mymatrixbraceright[4][m]{
    draw[mymatrixbrace] (#1.west|-#1-#3-1.south west) -- node[left=2pt] {#4} (#1.west|-#1-#2-1.north west);
    }
    newcommand*mymatrixbraceleft[4][m]{
    draw[mymatrixbrace] (#1.east|-#1-#2-1.north east) -- node[right=2pt] {#4} (#1.east|-#1-#2-1.south east);
    }
    newcommand*mymatrixbracetop[4][m]{
    draw[mymatrixbrace] (#1.north-|#1-1-#2.north west) -- node[above=2pt] {#4} (#1.north-|#1-1-#3.north east);
    }
    newcommand*mymatrixbracebottom[4][m]{
    draw[mymatrixbrace] (#1.south-|#1-1-#2.north east) -- node[below=2pt] {#4} (#1.south-|#1-1-#3.north west);
    }


    tikzset{style green/.style={
    set fill color=green!50!lime!60,draw opacity=0.4,
    set border color=green!50!lime!60,fill opacity=0.1,
    },
    style cyan/.style={
    set fill color=cyan!90!blue!60, draw opacity=0.4,
    set border color=blue!70!cyan!30,fill opacity=0.1,
    },
    style orange/.style={
    set fill color=orange!90, draw opacity=0.8,
    set border color=orange!90, fill opacity=0.3,
    },
    style brown/.style={
    set fill color=brown!70!orange!40, draw opacity=0.4,
    set border color=brown, fill opacity=0.3,
    },
    style purple/.style={
    set fill color=violet!90!pink!20, draw opacity=0.5,
    set border color=violet, fill opacity=0.3,
    },
    kwad/.style={
    above left offset={-0.1,0.23},
    below right offset={0.10,-0.36},
    #1
    },
    pion/.style={
    above left offset={-0.07,0.2},
    below right offset={0.07,-0.32},
    #1
    },
    poz/.style={
    above left offset={-0.03,0.18},
    below right offset={0.03,-0.3},
    #1
    }
    }

    [
    % mathbf{X} =
    begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]
    matrix [mymatrix,inner sep=4pt] (m)
    {
    tikzmarkin[kwad=style green]{Prime} v_{1,1} & v_{1,2} & tikzmarkin[pion=style purple]{VL} v_{1,3} & textcolor{white}{v_{1,4}} & & textcolor{white}{v_{1,6}} \
    v_{2,1} & v_{2,2} & v_{2,3} & & & \
    tikzmarkin[poz=style brown]{HL} v_{3,1} & v_{3,2} & tikzmarkin[kwad=style orange]{Mix} v_{3,3} tikzmarkend{Prime} &tikzmarkin[pion=style purple]{VR} v_{3,4} tikzmarkend{HL} & & \
    textcolor{white}{v_{4,1}} & & tikzmarkin[poz=style brown]{HR} v_{4,3} tikzmarkend{VL}& tikzmarkin[kwad=style cyan]{Bis} v_{4,4} tikzmarkend{Mix} & v_{4,5} & v_{4,6} tikzmarkend{HR} \
    & & & v_{5,4} & v_{5,5} & v_{5,6} \
    textcolor{white}{v_{6,1}} & & & v_{6,4} tikzmarkend{VR} & v_{6,5} & v_{6,6} tikzmarkend{Bis} \
    };

    % Braces
    mymatrixbraceright{1}{3}{$B'$}
    mymatrixbraceright{4}{6}{$B''$}
    mymatrixbracetop{1}{3}{$C'$}
    mymatrixbracetop{4}{6}{$C''$}
    mymatrixbracebottom{3}{3}{$F'$}
    mymatrixbracebottom{4}{4}{$F''$}
    mymatrixbraceleft{3}{3}{$E'$}
    mymatrixbraceleft{4}{4}{$E''$}
    end{tikzpicture}
    ]


    I was trying to change:



    begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]


    to



    begin{tikzpicture}[scale=2,baseline={-0.5ex},mymatrixenv]


    but without effect.



    I also tryied this when I import the picture to another document:



    begin{figure}
    centering
    scalebox{2}{
    input{color_matrix3.tikz}
    }
    end{figure}


    the output was indeed bigger but not centered and latex gave a lot of errors concerning math equations









    share

























      0












      0








      0







      I have the matrix:
      enter image description here



      which is obtained from the following code:



      usetikzlibrary{patterns}
      usetikzlibrary{matrix,decorations.pathreplacing,calc}


      %opening
      title{}
      author{}


      pgfkeys{tikz/mymatrixenv/.style={decoration={brace},every left delimiter/.style={xshift=8pt},every right delimiter/.style={xshift=-8pt}}}
      pgfkeys{tikz/mymatrix/.style={matrix of math nodes,nodes in empty cells,left delimiter={[},right delimiter={]},inner sep=1pt,outer sep=1.5pt,column sep=8pt,row sep=8pt,nodes={minimum width=20pt,minimum height=10pt,anchor=center,inner sep=0pt,outer sep=0pt}}}
      pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}

      newcommand*mymatrixbraceright[4][m]{
      draw[mymatrixbrace] (#1.west|-#1-#3-1.south west) -- node[left=2pt] {#4} (#1.west|-#1-#2-1.north west);
      }
      newcommand*mymatrixbraceleft[4][m]{
      draw[mymatrixbrace] (#1.east|-#1-#2-1.north east) -- node[right=2pt] {#4} (#1.east|-#1-#2-1.south east);
      }
      newcommand*mymatrixbracetop[4][m]{
      draw[mymatrixbrace] (#1.north-|#1-1-#2.north west) -- node[above=2pt] {#4} (#1.north-|#1-1-#3.north east);
      }
      newcommand*mymatrixbracebottom[4][m]{
      draw[mymatrixbrace] (#1.south-|#1-1-#2.north east) -- node[below=2pt] {#4} (#1.south-|#1-1-#3.north west);
      }


      tikzset{style green/.style={
      set fill color=green!50!lime!60,draw opacity=0.4,
      set border color=green!50!lime!60,fill opacity=0.1,
      },
      style cyan/.style={
      set fill color=cyan!90!blue!60, draw opacity=0.4,
      set border color=blue!70!cyan!30,fill opacity=0.1,
      },
      style orange/.style={
      set fill color=orange!90, draw opacity=0.8,
      set border color=orange!90, fill opacity=0.3,
      },
      style brown/.style={
      set fill color=brown!70!orange!40, draw opacity=0.4,
      set border color=brown, fill opacity=0.3,
      },
      style purple/.style={
      set fill color=violet!90!pink!20, draw opacity=0.5,
      set border color=violet, fill opacity=0.3,
      },
      kwad/.style={
      above left offset={-0.1,0.23},
      below right offset={0.10,-0.36},
      #1
      },
      pion/.style={
      above left offset={-0.07,0.2},
      below right offset={0.07,-0.32},
      #1
      },
      poz/.style={
      above left offset={-0.03,0.18},
      below right offset={0.03,-0.3},
      #1
      }
      }

      [
      % mathbf{X} =
      begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]
      matrix [mymatrix,inner sep=4pt] (m)
      {
      tikzmarkin[kwad=style green]{Prime} v_{1,1} & v_{1,2} & tikzmarkin[pion=style purple]{VL} v_{1,3} & textcolor{white}{v_{1,4}} & & textcolor{white}{v_{1,6}} \
      v_{2,1} & v_{2,2} & v_{2,3} & & & \
      tikzmarkin[poz=style brown]{HL} v_{3,1} & v_{3,2} & tikzmarkin[kwad=style orange]{Mix} v_{3,3} tikzmarkend{Prime} &tikzmarkin[pion=style purple]{VR} v_{3,4} tikzmarkend{HL} & & \
      textcolor{white}{v_{4,1}} & & tikzmarkin[poz=style brown]{HR} v_{4,3} tikzmarkend{VL}& tikzmarkin[kwad=style cyan]{Bis} v_{4,4} tikzmarkend{Mix} & v_{4,5} & v_{4,6} tikzmarkend{HR} \
      & & & v_{5,4} & v_{5,5} & v_{5,6} \
      textcolor{white}{v_{6,1}} & & & v_{6,4} tikzmarkend{VR} & v_{6,5} & v_{6,6} tikzmarkend{Bis} \
      };

      % Braces
      mymatrixbraceright{1}{3}{$B'$}
      mymatrixbraceright{4}{6}{$B''$}
      mymatrixbracetop{1}{3}{$C'$}
      mymatrixbracetop{4}{6}{$C''$}
      mymatrixbracebottom{3}{3}{$F'$}
      mymatrixbracebottom{4}{4}{$F''$}
      mymatrixbraceleft{3}{3}{$E'$}
      mymatrixbraceleft{4}{4}{$E''$}
      end{tikzpicture}
      ]


      I was trying to change:



      begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]


      to



      begin{tikzpicture}[scale=2,baseline={-0.5ex},mymatrixenv]


      but without effect.



      I also tryied this when I import the picture to another document:



      begin{figure}
      centering
      scalebox{2}{
      input{color_matrix3.tikz}
      }
      end{figure}


      the output was indeed bigger but not centered and latex gave a lot of errors concerning math equations









      share













      I have the matrix:
      enter image description here



      which is obtained from the following code:



      usetikzlibrary{patterns}
      usetikzlibrary{matrix,decorations.pathreplacing,calc}


      %opening
      title{}
      author{}


      pgfkeys{tikz/mymatrixenv/.style={decoration={brace},every left delimiter/.style={xshift=8pt},every right delimiter/.style={xshift=-8pt}}}
      pgfkeys{tikz/mymatrix/.style={matrix of math nodes,nodes in empty cells,left delimiter={[},right delimiter={]},inner sep=1pt,outer sep=1.5pt,column sep=8pt,row sep=8pt,nodes={minimum width=20pt,minimum height=10pt,anchor=center,inner sep=0pt,outer sep=0pt}}}
      pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}

      newcommand*mymatrixbraceright[4][m]{
      draw[mymatrixbrace] (#1.west|-#1-#3-1.south west) -- node[left=2pt] {#4} (#1.west|-#1-#2-1.north west);
      }
      newcommand*mymatrixbraceleft[4][m]{
      draw[mymatrixbrace] (#1.east|-#1-#2-1.north east) -- node[right=2pt] {#4} (#1.east|-#1-#2-1.south east);
      }
      newcommand*mymatrixbracetop[4][m]{
      draw[mymatrixbrace] (#1.north-|#1-1-#2.north west) -- node[above=2pt] {#4} (#1.north-|#1-1-#3.north east);
      }
      newcommand*mymatrixbracebottom[4][m]{
      draw[mymatrixbrace] (#1.south-|#1-1-#2.north east) -- node[below=2pt] {#4} (#1.south-|#1-1-#3.north west);
      }


      tikzset{style green/.style={
      set fill color=green!50!lime!60,draw opacity=0.4,
      set border color=green!50!lime!60,fill opacity=0.1,
      },
      style cyan/.style={
      set fill color=cyan!90!blue!60, draw opacity=0.4,
      set border color=blue!70!cyan!30,fill opacity=0.1,
      },
      style orange/.style={
      set fill color=orange!90, draw opacity=0.8,
      set border color=orange!90, fill opacity=0.3,
      },
      style brown/.style={
      set fill color=brown!70!orange!40, draw opacity=0.4,
      set border color=brown, fill opacity=0.3,
      },
      style purple/.style={
      set fill color=violet!90!pink!20, draw opacity=0.5,
      set border color=violet, fill opacity=0.3,
      },
      kwad/.style={
      above left offset={-0.1,0.23},
      below right offset={0.10,-0.36},
      #1
      },
      pion/.style={
      above left offset={-0.07,0.2},
      below right offset={0.07,-0.32},
      #1
      },
      poz/.style={
      above left offset={-0.03,0.18},
      below right offset={0.03,-0.3},
      #1
      }
      }

      [
      % mathbf{X} =
      begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]
      matrix [mymatrix,inner sep=4pt] (m)
      {
      tikzmarkin[kwad=style green]{Prime} v_{1,1} & v_{1,2} & tikzmarkin[pion=style purple]{VL} v_{1,3} & textcolor{white}{v_{1,4}} & & textcolor{white}{v_{1,6}} \
      v_{2,1} & v_{2,2} & v_{2,3} & & & \
      tikzmarkin[poz=style brown]{HL} v_{3,1} & v_{3,2} & tikzmarkin[kwad=style orange]{Mix} v_{3,3} tikzmarkend{Prime} &tikzmarkin[pion=style purple]{VR} v_{3,4} tikzmarkend{HL} & & \
      textcolor{white}{v_{4,1}} & & tikzmarkin[poz=style brown]{HR} v_{4,3} tikzmarkend{VL}& tikzmarkin[kwad=style cyan]{Bis} v_{4,4} tikzmarkend{Mix} & v_{4,5} & v_{4,6} tikzmarkend{HR} \
      & & & v_{5,4} & v_{5,5} & v_{5,6} \
      textcolor{white}{v_{6,1}} & & & v_{6,4} tikzmarkend{VR} & v_{6,5} & v_{6,6} tikzmarkend{Bis} \
      };

      % Braces
      mymatrixbraceright{1}{3}{$B'$}
      mymatrixbraceright{4}{6}{$B''$}
      mymatrixbracetop{1}{3}{$C'$}
      mymatrixbracetop{4}{6}{$C''$}
      mymatrixbracebottom{3}{3}{$F'$}
      mymatrixbracebottom{4}{4}{$F''$}
      mymatrixbraceleft{3}{3}{$E'$}
      mymatrixbraceleft{4}{4}{$E''$}
      end{tikzpicture}
      ]


      I was trying to change:



      begin{tikzpicture}[baseline={-0.5ex},mymatrixenv]


      to



      begin{tikzpicture}[scale=2,baseline={-0.5ex},mymatrixenv]


      but without effect.



      I also tryied this when I import the picture to another document:



      begin{figure}
      centering
      scalebox{2}{
      input{color_matrix3.tikz}
      }
      end{figure}


      the output was indeed bigger but not centered and latex gave a lot of errors concerning math equations







      tikz-pgf matrices scale





      share












      share










      share



      share










      asked 2 mins ago









      Filip Parker

      635




      635



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467657%2fhow-to-scale-a-tikz-matrix%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467657%2fhow-to-scale-a-tikz-matrix%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt