von MayaB. » Do 15. Dez 2011, 11:08
Hi,
ich habe das jetzt soweit geschafft, mit absoluten Positionen. Ist vielleicht nicht so elegant, aber funktioniert immerhin
Dafür habe ich aber neue Probleme:
Ich möchte nämlich zwei Graphen erstellen und diese nebeneinander anordnen. Ich habe das jetzt so probiert:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,automata,shapes}
\RequirePackage{atbegshi}
\newcommand*{\dbdownarrow}{% % double bar downarrow
\vbox{%
\hrule height0.5pt
\kern1.5pt
\hrule height0.5pt
\kern-0.45ex
\hbox{
\kern-0.25em
\ensuremath{\downarrow}
\kern-0.25em
}
}
}
\begin{document}
\begin{figure}[!H]
\caption{test}
\begin{minipage}{2cm}
\begin{flushleft}
\begin{tikzpicture}{->,>=stealth',shorten >=1pt,auto,semithick}
\tikzstyle{every state}=[minimum size=16pt,fill=white,text=black, node distance=2cm]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\node[state,shape=circle] (a) {$a$};
\node[state,shape=circle] (b) at (0, -1.5) {$b$};
\node[state,shape=circle] (c) at (1.5,0.75) {$c$};
\node[state,shape=circle] (d) at (1.5,-0.75) {$d$};
\node[state,shape=circle] (e) at (1.5,-2.25) {$e$};
\path[->] (a) edge node[above] {$\dbdownarrow$} (c)
(a) edge node[above, very near end] {$\dbdownarrow$} (e)
(b) edge node[above, near end] {$\downarrow$} (d)
;
\end{tikzpicture}
\end{flushleft}
\end{minipage}
\begin{minipage}{2cm}
\begin{flushright}
\begin{tikzpicture}{->,>=stealth',shorten >=1pt,auto,semithick}
\tikzstyle{every state}=[minimum size=16pt,fill=white,text=black, node distance=1.5cm]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\node[state,shape=circle] (c) {$c$};
\node[state,shape=circle] (d) [below of = c] {$d$};
\node[state,shape=circle] (e) [below of = d] {$e$};
\node[state,shape=circle] (c1)[right of = c] {$c$};
\node[state,shape=circle] (d1)[right of = d] {$d$};
\node[state,shape=circle] (e1) [right of = e] {$e$};
\path[->] (c) edge node[above] {$\dbdownarrow$} (c1)
(d) edge node[above] {$\downarrow$} (d1)
;
\end{tikzpicture}
\end{flushright}
\end{minipage}
\end{figure}
\end{document}
das sieht aber insofern bescheiden aus, dass die Graphen aus irgendeinem Grund
1. nicht auf gleicher Höhe sind
2. direkt aneinander liegen.
Als weiteres würde ich gerne die einzelnen Graphen noch beschriften. Wie mache ich das am schönsten?
Gruß,
maya
Hi,
ich habe das jetzt soweit geschafft, mit absoluten Positionen. Ist vielleicht nicht so elegant, aber funktioniert immerhin :roll:
Dafür habe ich aber neue Probleme:
Ich möchte nämlich zwei Graphen erstellen und diese nebeneinander anordnen. Ich habe das jetzt so probiert:
[code]
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,automata,shapes}
\RequirePackage{atbegshi}
\newcommand*{\dbdownarrow}{% % double bar downarrow
\vbox{%
\hrule height0.5pt
\kern1.5pt
\hrule height0.5pt
\kern-0.45ex
\hbox{
\kern-0.25em
\ensuremath{\downarrow}
\kern-0.25em
}
}
}
\begin{document}
\begin{figure}[!H]
\caption{test}
\begin{minipage}{2cm}
\begin{flushleft}
\begin{tikzpicture}{->,>=stealth',shorten >=1pt,auto,semithick}
\tikzstyle{every state}=[minimum size=16pt,fill=white,text=black, node distance=2cm]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\node[state,shape=circle] (a) {$a$};
\node[state,shape=circle] (b) at (0, -1.5) {$b$};
\node[state,shape=circle] (c) at (1.5,0.75) {$c$};
\node[state,shape=circle] (d) at (1.5,-0.75) {$d$};
\node[state,shape=circle] (e) at (1.5,-2.25) {$e$};
\path[->] (a) edge node[above] {$\dbdownarrow$} (c)
(a) edge node[above, very near end] {$\dbdownarrow$} (e)
(b) edge node[above, near end] {$\downarrow$} (d)
;
\end{tikzpicture}
\end{flushleft}
\end{minipage}
\begin{minipage}{2cm}
\begin{flushright}
\begin{tikzpicture}{->,>=stealth',shorten >=1pt,auto,semithick}
\tikzstyle{every state}=[minimum size=16pt,fill=white,text=black, node distance=1.5cm]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\node[state,shape=circle] (c) {$c$};
\node[state,shape=circle] (d) [below of = c] {$d$};
\node[state,shape=circle] (e) [below of = d] {$e$};
\node[state,shape=circle] (c1)[right of = c] {$c$};
\node[state,shape=circle] (d1)[right of = d] {$d$};
\node[state,shape=circle] (e1) [right of = e] {$e$};
\path[->] (c) edge node[above] {$\dbdownarrow$} (c1)
(d) edge node[above] {$\downarrow$} (d1)
;
\end{tikzpicture}
\end{flushright}
\end{minipage}
\end{figure}
\end{document}
[/code]
das sieht aber insofern bescheiden aus, dass die Graphen aus irgendeinem Grund
1. nicht auf gleicher Höhe sind
2. direkt aneinander liegen.
Als weiteres würde ich gerne die einzelnen Graphen noch beschriften. Wie mache ich das am schönsten? :-)
Gruß,
maya