Seite 1 von 1

Tikz und Linien

Verfasst: Mo 19. Feb 2018, 08:29
von ThoRie
Hallo, ich möchte gern folgende Graphik verändern:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{tikzorbital}
\begin{document}
\begin{tikzpicture}
\drawLevel[elec=pair,pos={(0,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xy}}
\drawLevel[elec=pair,pos={(1.5,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xz}}
\drawLevel[elec=pair,pos={(3,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{yz}}
\drawLevel[elec=up,pos={(4.5,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{z^2}}
\drawLevel[elec=up,pos={(6,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{x^2-y^2}}
\drawLevel[elec=up,pos={(9.7,2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{z^22}}
\drawLevel[elec=up,pos={(11.2,2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{x^2-y^22}}
\drawLevel[elec=pair,pos={(10.5,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xz2}}
\drawLevel[elec=pair,pos={(9,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xy2}}
\drawLevel[elec=pair,pos={(12,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{yz2}}
\draw[dashed] (right d_{x^2-y^2}) -- (left d_{z^22})
(right d_{x^2-y^2}) -- (left d_{xy2});
\node[right] at (right d_{x^2-y^22}) {$\text{e}_\text{g}$};
\node[right] at (right d_{yz2}) {$\text{t}_{2\text{g}}$};
\node[below of = middle d_{xy}] at (middle d_{xy}) {$d_{xy}$};
\node[below of = middle d_{xz}] at (middle d_{xz}) {$d_{xz}$};
\node[below of = middle d_{yz}] at (middle d_{yz}) {$d_{yz}$};
\node[below of = middle d_{z^2}] at (middle d_{z^2}) {$d_{z^2}$};
\node[below of = middle d_{x^2-y^2}] at (middle d_{x^2-y^2}) {$d_{x^2-y^2}$};
\node[below of = middle d_{xy2}] at (middle d_{xy2}) {$d_{xy}$};
\node[below of = middle d_{xz2}] at (middle d_{xz2}) {$d_{xz}$};
\node[below of = middle d_{yz2}] at (middle d_{yz2}) {$d_{yz}$};
\node[below of = middle d_{z^22}] at (middle d_{z^22}) {$d_{z^2}$};
\node[below of = middle d_{x^2-y^22}] at (middle d_{x^2-y^22}) {$d_{x^2-y^2}$};
\end{tikzpicture}
\end{document}
Und zwar soll das schon so aussehen, wie ich das habe, nur mit dem Unterschied, dass ich nicht möchte, dass die gestrichelten Linien direkt verlaufen.

Also zur Erklärung. Momentan ist es ja so, dass die gestrichelten Linien von d_{x^2-y^2} dierekt zu d_{z^2} bzw. d_{xy} verlaufen. Ich möchte aber, dass sie erstmal zwar auf diese Höhe gehen, aber ein Stück davor, sodass dann die Verbindung auf der Ebene von d_{z^2} bzw. d_{xy} waagerecht verläuft.

Ist das irgendwie möglich?

Re: Tikz und Linien

Verfasst: Mo 19. Feb 2018, 09:10
von markusv
ThoRie hat geschrieben:Ist das irgendwie möglich?
Probiere es mit
\draw[dashed] (right d_{x^2-y^2})  |- (left d_{z^22})
(right d_{x^2-y^2}) |- (left d_{xy2});
Also |- statt --.

Verfasst: Mo 19. Feb 2018, 09:29
von ThoRie
An sich funktioniert das zwar, aber ich möchte gern, dass die Striche schon erstmal diagonal los gehen :)

Verfasst: Mo 19. Feb 2018, 10:33
von Rolli
Hallo ThoRie,

also ungefähr so wie bei der oberen Linie?
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{tikzorbital}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\drawLevel[elec=pair,pos={(0,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xy}}
\drawLevel[elec=pair,pos={(1.5,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xz}}
\drawLevel[elec=pair,pos={(3,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{yz}}
\drawLevel[elec=up,pos={(4.5,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{z^2}}
\drawLevel[elec=up,pos={(6,0)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{x^2-y^2}}
\drawLevel[elec=up,pos={(9.7,2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{z^22}}
\drawLevel[elec=up,pos={(11.2,2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{x^2-y^22}}
\drawLevel[elec=pair,pos={(10.5,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xz2}}
\drawLevel[elec=pair,pos={(9,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{xy2}}
\drawLevel[elec=pair,pos={(12,-2)},width=1,style={line width=1pt,},spinstyle={thin,color=red!80,-stealth},spinlength=.7]{d_{yz2}}
\draw[dashed] (right d_{x^2-y^2}) -- ($(left d_{z^22})-(0.5,0)$) -- ++(0.5,0)
(right d_{x^2-y^2}) -- (left d_{xy2});
\node[right] at (right d_{x^2-y^22}) {$\text{e}_\text{g}$};
\node[right] at (right d_{yz2}) {$\text{t}_{2\text{g}}$};
\node[below of = middle d_{xy}] at (middle d_{xy}) {$d_{xy}$};
\node[below of = middle d_{xz}] at (middle d_{xz}) {$d_{xz}$};
\node[below of = middle d_{yz}] at (middle d_{yz}) {$d_{yz}$};
\node[below of = middle d_{z^2}] at (middle d_{z^2}) {$d_{z^2}$};
\node[below of = middle d_{x^2-y^2}] at (middle d_{x^2-y^2}) {$d_{x^2-y^2}$};
\node[below of = middle d_{xy2}] at (middle d_{xy2}) {$d_{xy}$};
\node[below of = middle d_{xz2}] at (middle d_{xz2}) {$d_{xz}$};
\node[below of = middle d_{yz2}] at (middle d_{yz2}) {$d_{yz}$};
\node[below of = middle d_{z^22}] at (middle d_{z^22}) {$d_{z^2}$};
\node[below of = middle d_{x^2-y^22}] at (middle d_{x^2-y^22}) {$d_{x^2-y^2}$};
\end{tikzpicture}
\end{document}
Gruß vom Rolli

Verfasst: Mo 19. Feb 2018, 10:54
von ThoRie
Danke, genau das habe ich gemeint :)

Das ist genau die perfekte Lösung :)