mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
added more CSV / function plotting examples
This commit is contained in:
parent
530ba6bb87
commit
d76640d4ea
11 changed files with 960 additions and 0 deletions
39
tikz/csv-line-plot-two-axes/csv-line-plot-two-axes.tex
Normal file
39
tikz/csv-line-plot-two-axes/csv-line-plot-two-axes.tex
Normal file
|
@ -0,0 +1,39 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage[utf8]{inputenc} % this is needed for umlauts
|
||||
\usepackage[ngerman]{babel} % this is needed for umlauts
|
||||
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
|
||||
\usepackage[margin=2.5cm]{geometry} %layout
|
||||
|
||||
\usepackage{pgfplots}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
axis x line=middle,
|
||||
axis y line=middle,
|
||||
enlarge y limits=true,
|
||||
xmin=0, xmax=2150,
|
||||
ymin=0, ymax=20000000,
|
||||
width=15cm, height=8cm, % size of the image
|
||||
grid = major,
|
||||
grid style={dashed, gray!30},
|
||||
ylabel=Stored game situations,
|
||||
xlabel=seconds,
|
||||
legend style={at={(0.1,-0.1)}, anchor=north}
|
||||
]
|
||||
\addplot table [x=seconds, y=situations, col sep=comma] {linearProbing.csv};
|
||||
\addplot table [x=seconds, y=situations, col sep=comma] {quadraticProbing.csv};
|
||||
\legend{linear probing,quadratic probing}
|
||||
\end{axis}
|
||||
|
||||
% this is the right axis
|
||||
\begin{axis}[
|
||||
hide x axis,
|
||||
axis y line*=right,
|
||||
width=15cm, height=8cm, % size of the image
|
||||
]
|
||||
\addplot[orange, mark=halfcircle] table [x=seconds, y=mirrored, col sep=comma] {linearProbing.csv};
|
||||
\addplot[black, mark=x] table [x=seconds, y=mirrored, col sep=comma] {quadraticProbing.csv};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue