how can I get formulas or texts to be positioned centrally within the cell of a table? Here is my code:
\documentclass[10pt,letterpaper]{article} \usepackage[lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in]{geometry} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{ % use this `compat' level or higher, so TikZ coordinates don't have to % be prefixed by `axis cs:' compat=1.11, } \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} % ------------------- % Content % ------------------- \begin{document} \begin{center} \pgfplotsset{width=0.8\linewidth, scale only axis, axis lines = middle, ticks=none, xlabel={$x$}, ylabel={$y$}, xlabel style={right}, ylabel style={above}, xmin=-4, xmax=4, % every axis plot post/.append style={ultra thick, smooth}, } \begin{tabularx}{\linewidth}{|C|C|C|} \hline & $n$~\textbf{gerade} & $n$~\textbf{ungerade} \\ \hline $a>0$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^2};% node [pos=0.7, below right] {\footnotesize{$x^2$}}; \node[color=black, font=\footnotesize] at (axis cs: 2.2,3) {$x^2$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {$\alpha>0$}; \end{tikzpicture} \medskip Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $+\infty$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^3}; %node [pos=0.8, above right] {\footnotesize{$x^3$}}; \node[color=black, font=\footnotesize] at (axis cs: 2.2,3) {$x^3$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {{$\alpha<0$}}; \end{tikzpicture} \medskip Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $+\infty$\\ \hline $a < 0$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {-x^2} node [pos=0.9, below right] {$f(x)=-x^2$}; \node[color=black, font=\footnotesize] at (axis cs: 2.5,-3) {$-x^2$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {$\alpha>0$}; \end{tikzpicture} \medskip Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $-\infty$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {-x^3} node [pos=0.9, above right] {$f(x)=-x^3$}; \node[color=black, font=\footnotesize] at (axis cs: 2.3,-3) {$-x^3$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {{$\alpha<0$}}; \end{tikzpicture} \medskip Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $-\infty$\\ \hline $|a| > 1$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^2}; \node[color=black, font=\footnotesize] at (axis cs: 1.5,1) {$x^2$}; %node [pos=0.1, below right] {$x^2$}; \addplot [color=red, domain=-4:4] {2*x^2} node [pos=0.9, below right] {$2x^2$}; \draw [-latex,color=red] (2,2) to (1,2); \node at (2.5,2) {\small \textcolor{red}{$2x^2$}}; \end{axis} %\node at (0.5,-0.2) {$\alpha>0$}; \end{tikzpicture} \medskip & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^3};% node [pos=0.9, above right] {$x^3$}; \node[color=black, font=\footnotesize] at (axis cs: 1.5,1) {$x^3$}; %node [pos=0.1, below right] {$x^2$}; \addplot [color=red, domain=-3:3] {2*x^3};% node [pos=0.9, above right] {$x^3$}; \draw [-latex,color=red] (2.2,3.456) to (1.2,3.456); \node at (2.7,3.456) {\small \textcolor{red}{$2x^3$}}; \end{axis} %\node at (0.5,-0.2) {{$\alpha<0$}}; \end{tikzpicture} \medskip \\ & \multicolumn{2}{c|}{ Dehnung in $y$-Richtung}\\ \hline $|a| < 1$ & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^2}; \draw [-latex] (2.5,2.25) to (1.5,2.25); \node at (2.85,2.25) {\small $x^2$}; \addplot [color=red, domain=-4:4] {(1/2)*x^2}; \node[color=red, font=\footnotesize] at (axis cs: 2,0.5) {$\frac{1}{2}x^2$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {$\alpha>0$}; \end{tikzpicture} \medskip & \begin{tikzpicture} \begin{axis}[ymin=-4, ymax=4] \addplot [domain=-3:3] {x^3}; \draw [-latex] (2.5,3.375) to (1.5,3.375); \node at (2.85,3.375) {\small $x^2$}; \addplot [color=red, domain=-3:3] {(1/2)*x^3};% node [pos=0.9, above right] {$x^3$}; \node[color=red, font=\footnotesize] at (axis cs: 2.1,1.5) {$\frac{1}{2}x^3$}; %node [pos=0.1, below right] {$x^2$}; \end{axis} %\node at (0.5,-0.2) {{$\alpha<0$}}; \end{tikzpicture} \medskip \\ & \multicolumn{2}{c|}{ Stauchung in $y$-Richtung}\\ \hline \end{tabularx} \end{center} \end{document} As you can see, the text is located relatively far down within the first column.





tabularray?lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1inmay be expressed more succinctly asmargin=1in.