von markusv » Fr 17. Apr 2020, 07:26
Ist ein wenig Gefriemel, aber mit TikZ lässt sich da schon einiges machen. Wenn man noch etwas überlegt mit der Koordinatenwahl und \foreach-Schleifen heran geht, spart man sich noch einiges an Tipperei:
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2,execute at begin node=$, execute at end node=$]
%Koordinatenachsen
\draw[-latex] (-3,-3) --++ (0,1) node[above left] {y};
\draw[-latex] (-3,-3) --++ (1,0) node[below right] {x};
%grid waagerechte Linien
\foreach \x in {-2,-1,+1}{
\draw (-2.5,\x) node[below] {y_{i\x}} --++ (4,0);
}
\draw (-2.5,0) node[below] {y_{i}} --++ (4,0);
%grid senkrechte Linien
\foreach \x in {-2,-1,+1}{
\draw (\x,-2.5) node[below] {x_{i\x}} --++ (0,4);
}
\draw (0,-2.5) node[below] {x_{i}} --++ (0,4);
%Punkte
\fill (-.5,-.5) coordinate(P) circle (1pt) node[above] {P};
\foreach \x/\y in {0/E,90/N,180/W,270/S}{
\path (P) --++ (\x:1) coordinate(\y) coordinate[pos=.5] (P\y);
\fill (\y) circle (1pt) node[above] {\y};
\draw[-latex] (P\y) --++ (\x:.25) node[pos=-.375] {\MakeLowercase{\y}};
}
\foreach \x/\y in {N/E,N/W,S/E,S/W}{
\path (\x) -| (\y) coordinate[pos=.5] (\x\y);
\fill (\x\y) circle (1pt) node[above] {\x\y};
\path (P) -- (\x\y) node[pos=.375] {\MakeLowercase{\x\y}};
}
\end{tikzpicture}
\end{document}
Ist ein wenig Gefriemel, aber mit TikZ lässt sich da schon einiges machen. Wenn man noch etwas überlegt mit der Koordinatenwahl und [tt]\foreach[/tt]-Schleifen heran geht, spart man sich noch einiges an Tipperei:[code]\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2,execute at begin node=$, execute at end node=$]
%Koordinatenachsen
\draw[-latex] (-3,-3) --++ (0,1) node[above left] {y};
\draw[-latex] (-3,-3) --++ (1,0) node[below right] {x};
%grid waagerechte Linien
\foreach \x in {-2,-1,+1}{
\draw (-2.5,\x) node[below] {y_{i\x}} --++ (4,0);
}
\draw (-2.5,0) node[below] {y_{i}} --++ (4,0);
%grid senkrechte Linien
\foreach \x in {-2,-1,+1}{
\draw (\x,-2.5) node[below] {x_{i\x}} --++ (0,4);
}
\draw (0,-2.5) node[below] {x_{i}} --++ (0,4);
%Punkte
\fill (-.5,-.5) coordinate(P) circle (1pt) node[above] {P};
\foreach \x/\y in {0/E,90/N,180/W,270/S}{
\path (P) --++ (\x:1) coordinate(\y) coordinate[pos=.5] (P\y);
\fill (\y) circle (1pt) node[above] {\y};
\draw[-latex] (P\y) --++ (\x:.25) node[pos=-.375] {\MakeLowercase{\y}};
}
\foreach \x/\y in {N/E,N/W,S/E,S/W}{
\path (\x) -| (\y) coordinate[pos=.5] (\x\y);
\fill (\x\y) circle (1pt) node[above] {\x\y};
\path (P) -- (\x\y) node[pos=.375] {\MakeLowercase{\x\y}};
}
\end{tikzpicture}
\end{document}[/code]