Add section about pgfplots

This commit is contained in:
Julius Freudenberger 2025-09-24 13:20:11 +02:00
parent 1163a6039a
commit 916e4fc27a
7 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,13 @@
\begin{tikzpicture}
\begin{axis}[
title=Bar chart,
]
\addplot [
green,
fill=green!60!black,
ybar,
] table
{codebeispiele/pgfplots-bars.dat};
\legend{Quartalszahlen}
\end{axis}
\end{tikzpicture}

View file

@ -0,0 +1,6 @@
1 1
2 2
3 -3
4 0
5 3
6 4

View file

@ -0,0 +1,9 @@
-4 16
-3 9
-2 4
-1 1
0 0
1 1
2 4
3 9
4 16

View file

@ -0,0 +1,12 @@
\begin{tikzpicture}
\begin{axis}[
title=Import from table,
xlabel={$x$},
ylabel={$y$},
legend pos = outer north east,
]
\addplot [blue] table
{codebeispiele/pgfplots-data.dat};
\legend{$\approx x^2$}
\end{axis}
\end{tikzpicture}

View file

@ -0,0 +1,2 @@
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

View file

@ -0,0 +1,12 @@
\begin{tikzpicture}
\begin{axis}[
title={Beispieldiagramm},
xlabel={$x$-Achse},
ylabel={$y$-Achse},
]
\addplot[red,
domain=-5:5,
samples=100] { x^2 };
\legend{$x^2$}
\end{axis}
\end{tikzpicture}