将矩阵放在图表旁边

将矩阵放在图表旁边
\documentclass[a4paper,12pt,twoside]{report}
\usetikzlibrary{decorations.markings}
\begin{document}
 \begin{figure}[hbt!]
    \begin{center}
    \begin{tikzpicture}[scale=0.95,
                thick,
                acteur/.style={
                    circle,
                    fill=black,
                    thick,
                    inner sep=2pt,
                    minimum size=0.2cm,scale=0.65
                }
                ] 
                \node (a1) at (0,0) [acteur,label=left:\footnotesize{1}]{}; 
                \node (a2) at (1.5,0)  [acteur,label=right:\footnotesize{2}]{};           
                \node (a3) at (1.5,1.5) [acteur,label=right:\footnotesize{3}]{};     
                \node (a4) at (0,1.5) [acteur,label=left:\footnotesize{4}]{};         
                \node (a5) at (.75,3) [acteur,label=above:\footnotesize{5}]{};                
                \draw [green, decoration={markings, mark=at position 0.5 with {\arrow{>}}}, postaction={decorate}]  (a1) -- (a2); 
                \draw  [blue](a2) -- (a3); 
                \draw [green, decoration={markings, mark=at position 0.5 with {\arrow{>}}}, postaction={decorate}]  (a3) -- (a4);
                \draw  [red](a4) -- (a1);
                \draw [blue] (a4) -- (a5);
                \draw [red]  (a5) -- (a3);
                A(G)=
  \left[ {\begin{array}{rrrrr}
   0 & \mathrm{i} & 0 & 1 & 0 \\
   -\mathrm{i} & 0 & -1 &0 &0 \\
   0 & -1 & 0 & \mathrm{i} & 1\\
   1 & 0 & -\mathrm{i} &0 & -1\\
   0 & 0 &1 &-1 &0
  \end{array} } \right]
            \end{tikzpicture}
            
            
            
            
          \caption{ $G, A(G)$}\label{F2}
          \end{center}
    \end{figure}
\end{document}

这里我想将矩阵放在图表的右侧。该怎么做?

答案1

您可以(应该)在图像外面写入矩阵:

在此处输入图片描述

我擅自重写了您的图像的代码(目的是更简单):

\documentclass[a4paper,12pt,twoside]{report}
\usepackage{mathtools}  % new
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{figure}[hbt!]
    \centering
    \begin{tikzpicture}[baseline=(a3.south),
acteur/.style = {circle, draw, fill, inner sep=2pt,
                 node contents={}},
   ->-/.style = {decoration={markings, mark=at position 0.5 with {\arrow{>}}},
                 draw=#1, 
                 postaction={decorate}},                
every label/.append style = {font=\footnotesize},
 every path/.append style = semithick
                ]
\node (a1)              [acteur,label=left:1];
\node (a2) at (1.5,0.0) [acteur,label=right:2];
\node (a3) at (1.5,1.5) [acteur,label=right:3];
\node (a4) at (0.0,1.5) [acteur,label=left:4];
\node (a5) at (.75,3.0) [acteur,label=5];
%
\draw [->- = green]  (a1) -- (a2);
\draw [blue] (a2) -- (a3);
\draw [->- = blue]   (a3) -- (a4);
\draw [red]  (a4) -- (a1);
\draw [blue] (a4) -- (a5);
\draw [red]  (a5) -- (a3);
   \end{tikzpicture}
\qquad
$A(G)= \begin{bmatrix*}[r]
    0   &  i &  0 &  1 &  0 \\
   -i   &  0 & -1 &  0 &  0 \\
   0    & -1 &  0 &  i &  1 \\
   1    &  0 &  i &  0 & -1 \\
   0    &  0 &  1 & -1 &  0
    \end{bmatrix*}$

\caption{ $G, A(G)$}\label{Fd2}
    \end{figure}
\end{document} 

答案2

\documentclass[a4paper,12pt,twoside]{report}
\usetikzlibrary{decorations.markings}
\begin{document}

\begin{figure}[hbt!]
    \begin{center}
    \begin{tikzpicture}[scale=0.95,
                thick,
                acteur/.style={
                    circle,
                    fill=black,
                    thick,
                    inner sep=2pt,
                    minimum size=0.2cm,scale=0.65
                }
                ] 
                \node (a1) at (0,0) [acteur,label=left:\footnotesize{1}]{}; 
                \node (a2) at (1.5,0)  [acteur,label=right:\footnotesize{2}]{};           
                \node (a3) at (1.5,1.5) [acteur,label=right:\footnotesize{3}]{};     
                \node (a4) at (0,1.5) [acteur,label=left:\footnotesize{4}]{};         
                \node (a5) at (.75,3) [acteur,label=above:\footnotesize{5}]{};                
                \draw [green, decoration={markings, mark=at position 0.5 with {\arrow{>}}}, postaction={decorate}]  (a1) -- (a2); 
                \draw  [blue](a2) -- (a3); 
                \draw [green, decoration={markings, mark=at position 0.5 with {\arrow{>}}}, postaction={decorate}]  (a3) -- (a4);
                \draw  [red](a4) -- (a1);
                \draw [blue] (a4) -- (a5);
                \draw [red]  (a5) -- (a3);
               \draw (7, 1.5) node {$A(G)=
  \left[ {\begin{array}{rrrrr}
   0 & \mathrm{i} & 0 & 1 & 0 \\
   -\mathrm{i} & 0 & -1 &0 &0 \\
   0 & -1 & 0 & \mathrm{i} & 1\\
   1 & 0 & -\mathrm{i} &0 & -1\\
   0 & 0 &1 &-1 &0
  \end{array} } \right]$};
   \end{tikzpicture}
               
\caption{ $G, A(G)$}\label{Fd2}
          \end{center}
    \end{figure} 
\end{document} 

相关内容