Tikz und Linien

Tabellen und Grafiken erstellen und anordnen


ThoRie
Forum-Century
Forum-Century
Beiträge: 159
Registriert: Fr 12. Mai 2017, 11:57

Tikz und Linien

Beitrag 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?

markusv
Forum-Meister
Forum-Meister
Beiträge: 947
Registriert: Do 3. Sep 2015, 17:20
Wohnort: Leipzig

Re: Tikz und Linien

Beitrag 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 --.
Wäre Microsoft Word für das Schreiben von Büchern entwickelt worden,
würde es Microsoft Book heißen.

Unkomplizierte und schnelle LaTeX-Hilfe, bspw. Erstellung von Vorlagen und Bewerbungen:
Help-LaTeX@web.de

ThoRie
Forum-Century
Forum-Century
Beiträge: 159
Registriert: Fr 12. Mai 2017, 11:57

Beitrag von ThoRie »

An sich funktioniert das zwar, aber ich möchte gern, dass die Striche schon erstmal diagonal los gehen :)

Rolli
Forum-Guru
Forum-Guru
Beiträge: 382
Registriert: Mi 15. Feb 2017, 08:50
Wohnort: Mittelfranken

Beitrag 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

ThoRie
Forum-Century
Forum-Century
Beiträge: 159
Registriert: Fr 12. Mai 2017, 11:57

Beitrag von ThoRie »

Danke, genau das habe ich gemeint :)

Das ist genau die perfekte Lösung :)

Antworten