Add section about pgfplots
This commit is contained in:
parent
1163a6039a
commit
916e4fc27a
7 changed files with 124 additions and 0 deletions
13
codebeispiele/pgfplots-bar-chart.tex
Normal file
13
codebeispiele/pgfplots-bar-chart.tex
Normal 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}
|
6
codebeispiele/pgfplots-bars.dat
Normal file
6
codebeispiele/pgfplots-bars.dat
Normal file
|
@ -0,0 +1,6 @@
|
|||
1 1
|
||||
2 2
|
||||
3 -3
|
||||
4 0
|
||||
5 3
|
||||
6 4
|
9
codebeispiele/pgfplots-data.dat
Normal file
9
codebeispiele/pgfplots-data.dat
Normal file
|
@ -0,0 +1,9 @@
|
|||
-4 16
|
||||
-3 9
|
||||
-2 4
|
||||
-1 1
|
||||
0 0
|
||||
1 1
|
||||
2 4
|
||||
3 9
|
||||
4 16
|
12
codebeispiele/pgfplots-plot-data.tex
Normal file
12
codebeispiele/pgfplots-plot-data.tex
Normal 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}
|
2
codebeispiele/pgfplots-setup.tex
Normal file
2
codebeispiele/pgfplots-setup.tex
Normal file
|
@ -0,0 +1,2 @@
|
|||
\usepackage{pgfplots}
|
||||
\pgfplotsset{compat=1.18}
|
12
codebeispiele/pgfplots.tex
Normal file
12
codebeispiele/pgfplots.tex
Normal 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}
|
Loading…
Add table
Add a link
Reference in a new issue