Was kann ich einstellen, damit meine Pfeilbeschriftung exakt auf einer Höhe ist und nicht bei jedem beschrifteten Pfeil verschieden? Ich versuche es nun schon eine ganze Weile, aber habe bisher noch keine Lösung für mein Problem gefunden.

Folgend ein Beispiel. Ich möchte am Ende alle T's auf die Höhe von T_2 anpassen und suche nach einer Lösung dafür. Schonmal vielen Dank!

Code, hier editierbar zum Übersetzen:
\documentclass{scrarticle}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{arrows,trees,graphs,positioning, arrows, chains, shapes, arrows.meta,decorations.pathreplacing}
\begin{document}
\begin{figure}[h]
\begin{tikzpicture}[>=Stealth]
% Koordinatensystem
\draw[->,>=Stealth,thick] (0,0) -- (12.5,0) node[below=0.2] {x};
\draw[->,thick] (0,0) -- (0,6) node[below left=0.3,anchor=east] {y};
\begin{scope}[ultra thin,every edge/.append style={->}]
\foreach [count=\i] \x/\y in {
0.2/5,
2.7/4.6,
5.2/3.7,
7.7/3.4,
10.2/4.4
}{
\path (\x,0) -- (\x,\y) node (h) [pos=.6] {~$T_\i$};
\path (h) edge (\x,0) edge (\x,\y);
}
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 01 Jun '21, 11:08

lina_36's gravatar image

lina_36
4127
Akzeptiert-Rate: 0%

bearbeitet 01 Jun '21, 11:09

Du könntest in Zeile 23 Folgendes verwenden: \path (\x,\y) -- (\x,0) node (h) [yshift=2cm] {~$T_\i$};

(01 Jun '21, 12:35) Cletus

Off topic: Wenn Du arrows.meta lädst, kannst Du eigentlich auch arrows verzichten. Im Beispiel lädst Du arrows sogar doppelt. Das sollte man vermeiden, genau wie das Laden von im Code nicht verwendeten Dateien. pgfplots lädt automatisch tikz. Wenn man pgfplots lädt, braucht man also nicht nochmal tikz zu laden. Für das Beispiel genügt aber tikz.

(01 Jun '21, 14:07) esdd

Du kannst einfach eine feste vertikale Position für die Tᵢ vorgeben, z.B. y=2.8. Dann kann auch auf den Hilfsnode \h verzichtet werden:

\path (\x,2.8) node {~$T_\i$} edge (\x,0) edge (\x,\y);
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Beispiel:

Code, hier editierbar zum Übersetzen:
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{figure}[htp]
\begin{tikzpicture}[>=Stealth]
% Koordinatensystem
\draw[->,>=Stealth,thick] (0,0) -- (12.5,0) node[below=0.2] {x};
\draw[->,thick] (0,0) -- (0,6) node[below left=0.3,anchor=east] {y};
\begin{scope}[ultra thin,every edge/.append style={->}]
\foreach [count=\i] \x/\y in {
0.2/5,
2.7/4.6,
5.2/3.7,
7.7/3.4,
10.2/4.4
}{
\path (\x,2.8) node {~$T_\i$} edge (\x,0) edge (\x,\y);% Beschriftung wird bei y=2.8 eingefügt
}
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Permanenter link

beantwortet 01 Jun '21, 14:02

esdd's gravatar image

esdd
17.8k284257
Akzeptiert-Rate: 62%

bearbeitet 01 Jun '21, 14:18

Vielen Dank!

(01 Jun '21, 15:30) lina_36

Die Beschriftung soll also einheitlich bei 60% von 4.6=yUse erscheinen; dann musst Du die pos für die anderen y eben ausrechnen:

Code, hier editierbar zum Übersetzen:
\pgfmathsetmacro\yUse{4.6}
\pgfmathsetmacro\Tpos{0.6*\yUse/\y}
\path (\x,0) -- (\x,\y) node (h) [pos=\Tpos] {~$T_\i$};
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Damit:

alt text

Code, hier editierbar zum Übersetzen:
\documentclass{scrarticle}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{figure}[h]
\begin{tikzpicture}[>=Stealth]
% Koordinatensystem
\draw[->,>=Stealth,thick] (0,0) -- (12.5,0) node[below=0.2] {x};
\draw[->,thick] (0,0) -- (0,6) node[below left=0.3,anchor=east] {y};
\pgfmathsetmacro\yUse{4.6}
\begin{scope}[ultra thin,every edge/.append style={->}]
\foreach [count=\i] \x/\y in {
0.2/5,
2.7/4.6,
5.2/3.7,
7.7/3.4,
10.2/4.4
}{
\pgfmathsetmacro\Tpos{0.6*\yUse/\y}
\path (\x,0) -- (\x,\y) node (h) [pos=\Tpos] {~$T_\i$};
\path (h) edge (\x,0) edge (\x,\y);
\node[anchor=north west, font=\footnotesize, red] at (\x,0.9*\Tpos*\y) {(\Tpos)}; % zur Anzeige
}
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Permanenter link

beantwortet 03 Jun '21, 10:26

coversin's gravatar image

coversin
9127
Akzeptiert-Rate: 50%

bearbeitet 03 Jun '21, 10:45

Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×731
×30
×6

gestellte Frage: 01 Jun '21, 11:08

Frage wurde gesehen: 3,983 Mal

zuletzt geändert: 03 Jun '21, 10:45

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×