von Erzin » Mi 15. Mai 2019, 14:07
Hey Leute, ich versuche gerade einen Graphen und eine Matrix nebeneinander zu bekommen und zwar mit tikzpicture, aber sie sind nie auf der selben Ebene. Würde mich freuen wenn einer mal rüber schauen kann.
Vielen Dank.
Die Pakete sind auch gespeichert.
\begin{figure}[htb]
\centering
\begin{minipage}[t]{.45\linewidth}
\centering
\begin{tikzpicture}[scale=2]
% Knoten
\node (A) at (1,2) [circle,draw] {1};
\node (B) at (2,2) [circle,draw] {2};
\node (D) at (2,1.25) [circle,draw] {4};
%\node (D) at (1,1) [circle,draw] {D};
\node (C) at (1,1.25) [circle,draw] {3};
% Kanten
\draw[->] (A) to (B);
\draw[->] (B) to (A);
%\draw[-] (E) to (D);
%\draw[-] (E) to (B);
%\draw[-] (E) to (A);
\draw[<-] (D) to (C);
\draw[<-] (C) to (D);
\end{tikzpicture}
\subcaption{Test1}
\end{minipage}%
\hfill%
\begin{minipage}[t]{.45\linewidth}
\centering
$\left( \begin{array}{rrrr}
0 & 1 & 0 & 0 \\
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{array}\right)$
\subcaption{Test2}
\end{minipage}
\caption{Bildtitel}
\end{figure}
[/code]
Hey Leute, ich versuche gerade einen Graphen und eine Matrix nebeneinander zu bekommen und zwar mit tikzpicture, aber sie sind nie auf der selben Ebene. Würde mich freuen wenn einer mal rüber schauen kann.
Vielen Dank.
Die Pakete sind auch gespeichert.
[code]
\begin{figure}[htb]
\centering
\begin{minipage}[t]{.45\linewidth}
\centering
\begin{tikzpicture}[scale=2]
% Knoten
\node (A) at (1,2) [circle,draw] {1};
\node (B) at (2,2) [circle,draw] {2};
\node (D) at (2,1.25) [circle,draw] {4};
%\node (D) at (1,1) [circle,draw] {D};
\node (C) at (1,1.25) [circle,draw] {3};
% Kanten
\draw[->] (A) to (B);
\draw[->] (B) to (A);
%\draw[-] (E) to (D);
%\draw[-] (E) to (B);
%\draw[-] (E) to (A);
\draw[<-] (D) to (C);
\draw[<-] (C) to (D);
\end{tikzpicture}
\subcaption{Test1}
\end{minipage}%
\hfill%
\begin{minipage}[t]{.45\linewidth}
\centering
$\left( \begin{array}{rrrr}
0 & 1 & 0 & 0 \\
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{array}\right)$
\subcaption{Test2}
\end{minipage}
\caption{Bildtitel}
\end{figure}
[/code][/code]