2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
LaTeX-examples/tikz/x-3-cubic-function/x-3-cubic-function.tex
Martin Thoma 7740f0147f Remove trailing spaces
The commands

find . -type f -name '*.md' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

and

find . -type f -name '*.tex' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

were used to do so.
2015-10-14 14:25:34 +02:00

33 lines
990 B
TeX

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend pos=south east,
axis x line=middle,
axis y line=middle,
grid = major,
width=8cm,
height=12cm,
grid style={dashed, gray!30},
xmin=-2, % start the diagram at this x-coordinate
xmax= 2, % end the diagram at this x-coordinate
ymin=-8, % start the diagram at this y-coordinate
ymax= 8, % end the diagram at this y-coordinate
axis background/.style={fill=white},
xlabel=x,
ylabel=y,
%xticklabels={-2,-1.6,...,2},
%yticklabels={-8,-7,...,8},
tick align=outside,
enlargelimits=true,
tension=0.08]
% plot the stirling-formulae
\addplot[domain=-2:2, red, thick,samples=500] {x*x*x};
\addlegendentry{$f(x)=x^3$}
\end{axis}
\end{tikzpicture}
\end{document}