4

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.

enter image description here

3
  • would you consider the use of tabularray ?
    – JeT
    Apr 13 at 8:18
  • @JeT I would also consider it. Is there the possibility of positioning texts individually?
    – wayne
    Apr 13 at 8:20
  • 3
    Off-topic: lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in may be expressed more succinctly as margin=1in.
    – Mico
    Apr 13 at 8:35

3 Answers 3

6

If your table consists of multiple paragraphs and a mix of texts and pictures, the default alignment is always w.r.t. the first topmost baselines of each cell. For texts it is a bottom characters. For pictures it is a bottom edge. pfgplots also keeps baselines of its drawings at the south west or left-hand side lower corners. This is why texts in the first column is positioned at the bottom of the axes.

One way is to use anchor of each axis as an optional setting and change the point to say centre. Another way is to set baseline of the whole tikzpicture to the centre of the axis. Both approaches move the default baseline, w.r.t. which texts in the first cell will be aligned. Note, this is NOT the centre of the cell because cells also contain captions which in this case are not included. If you want a perfect middle alignment in the cell, use other solutions.

To move baseline to centre of an axis, add the following to a preamble:

\tikzset{
    baseline={([yshift=-0.7ex]current axis.center)},
}

yshift is an optional argument for further adjustment. Here, it is merely a compensation for the height of characters.

The full code:

\documentclass[10pt,letterpaper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\tikzset{
    baseline={([yshift=-0.7ex]current axis.center)},
}

\pgfplotsset{
    width=1.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{document}
\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}
    \par\medskip
    \par 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} 
      \par\medskip   
      \par 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} 
      \par \medskip
      \par 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} 
      \par\medskip
      \par 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}
    & \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{document}

enter image description here

5

You need to run the instruction

\renewcommand{\tabularxcolumn}[1]{m{#1}}

in the preamble, after loading the tabularx package. (The default setting is \newcommand{\tabularxcolumn}[1]{p{#1}}.) See section 4.2 of the user guide of the tabularx package for further information.

enter image description here

\documentclass[10pt,letterpaper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.11}
\usepackage[ngerman]{babel}
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand{\tabularxcolumn}[1]{m{#1}}

% -------------------
% 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}{|wc{1.5in}|C|C|}
\hline
& $n$ gerade & $n$ 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äuft 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äuft 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äuft 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äuft 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}
0
4

The answer has already been given by @Mico, but you might benefit from the powerful tabularray

enter image description here

\documentclass[10pt,letterpaper]{article}
\usepackage[lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{graphicx} 
\usepackage{tabularray}
\UseTblrLibrary{booktabs}


    
\pgfplotsset{
        compat=1.11,
        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{filecontents*}{tikzPicture1.tex}
\begin{tikzpicture}
\begin{axis}[ymin=-4, ymax=4]
\addplot [domain=-3:3] {x^2};
\node[color=black, font=\footnotesize] at (axis cs: 2.2,3) {$x^2$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture2.tex}
\begin{tikzpicture}
\begin{axis}[ymin=-4, ymax=4]
\addplot [domain=-3:3] {x^3};
\node[color=black, font=\footnotesize] at (axis cs: 2.2,3) {$x^3$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture3.tex}
\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$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture4.tex}
\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$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture5.tex}
\begin{tikzpicture}
\begin{axis}[ymin=-4, ymax=4]
\addplot [domain=-3:3] {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$}};
\node[color=black, font=\footnotesize] at (axis cs: 1.5,1) {$x^2$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture6.tex}
\begin{tikzpicture}
\begin{axis}[ymin=-4, ymax=4]
\addplot [domain=-3:3] {x^3};
\addplot [color=red, domain=-3:3] {2*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$}};
\node[color=black, font=\footnotesize] at (axis cs: 1.5,1) {$x^3$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture7.tex}
\begin{tikzpicture}
\begin{axis}[ymin=-4, ymax=4]
\addplot [domain=-3:3] {x^2};
\addplot [color=red, domain=-4:4] {(1/2)*x^2};
\draw [-latex] (2.5,2.25) to (1.5,2.25);
\node[color=red, font=\footnotesize] at (axis cs: 2,0.5) {$\frac{1/2}x^2$};
\node at (2.85,2.25) {\small $x^2$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}

\begin{filecontents*}{tikzPicture8.tex}
\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^3$};
\addplot [color=red, domain=-3:3] {(1/2)*x^3};
\node[color=red, font=\footnotesize] at (axis cs: 2.1,1.5) {$\frac{1/2}x^3$};
\end{axis}
\end{tikzpicture}
\end{filecontents*}
    
\newcommand{\myimage}[1]{\input{tikzPicture#1}}
    
\begin{document}
    
\begin{tblr}{
        colspec = {X[c,m]X[c,m]X[c,m]},
        width = \linewidth,
        row{1} = {font=\bfseries},
        vlines,
        hline{1,2,4,6,8,10} = {solid},
    }
            
    & {$n$ gerade} & {$n$ ungerade} \\
    \SetCell[r=2]{c} {$a > 0$}
    & \myimage{1} 
    & \myimage{2} 
    \\    
    & Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $+\infty$
    & Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $+\infty$ 
    \\
    \SetCell[r=2]{c} {$a < 0$}
    & \myimage{3} 
    & \myimage{4} 
    \\
    & Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $-\infty$
    & Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $-\infty$ 
    \\
    \SetCell[r=2]{c} {$|a| > 1$}
    & \myimage{5}
    & \myimage{6}
    \\
    & \SetCell[c=2]{c} Dehnung in $y$-Richtung \\
    \SetCell[r=2]{c} {$|a| < 1$}
    & \myimage{7}
    & \myimage{8} 
    \\
    & \SetCell[c=2]{c} Stauchung in $y$-Richtung \\
\end{tblr}
    
\end{document} 

For a simple MWE

enter image description here

\documentclass[10pt,letterpaper]{article}
\usepackage[lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{graphicx} 
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\pgfplotsset{
    compat=1.11,
    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},
}

\newcommand{\myimage}{\includegraphics[width=\linewidth,height=35mm]{example-image}}

\begin{document}

\begin{tblr}{
        colspec = {X[c,m]X[c,m]X[c,m]},
        width = \linewidth,
        row{1} = {font=\bfseries},
        vlines,
        hline{1,2,4,6,8,10} = {solid},
        
    }
    
    & {$n$ gerade} & {$n$ ungerade} \\
    \SetCell[r=2]{c} {$a > 0$}
    & \myimage 
    & \myimage 
    \\    
    & Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $+\infty$
    & Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $+\infty$ 
    \\
    \SetCell[r=2]{c} {$a < 0$}
    & \myimage 
    & \myimage 
    \\
    & Der Graph der Potenzfunktion verl\"auft von $-\infty$ nach $-\infty$
    & Der Graph der Potenzfunktion verl\"auft von $+\infty$ nach $-\infty$ 
    \\
    \SetCell[r=2]{c} {$|a| > 1$}
    & \myimage 
    & \myimage
    \\
    & \SetCell[c=2]{c} Dehnung in $y$-Richtung \\
    \SetCell[r=2]{c} {$|a| < 1$}
    & \myimage
    & \myimage \\
    & \SetCell[c=2]{c} Stauchung in $y$-Richtung \\
\end{tblr}

\end{document} 
3
  • 1
    This is also a very great answer. Tabullararray seems to be very powerful. Thank you very much!
    – wayne
    Apr 13 at 9:01
  • 1
    tabularray simplifies everything in table management.
    – JeT
    Apr 13 at 9:03
  • 1
    @wayne you might want to switch from colspec = {X[c,m]X[c,m]X[c,m]} to colspec = {Q[c,m]X[c,m]X[c,m]}
    – JeT
    Apr 13 at 9:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .