mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
added function x^3
This commit is contained in:
parent
d65436f185
commit
245fc4a131
2 changed files with 64 additions and 0 deletions
31
tikz/x-3-cubic-function/Makefile
Normal file
31
tikz/x-3-cubic-function/Makefile
Normal file
|
@ -0,0 +1,31 @@
|
|||
SOURCE = x-3-cubic-function
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
WIDTH = 500
|
||||
|
||||
make:
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||
|
||||
gif:
|
||||
pdfcrop $(SOURCE).pdf
|
||||
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||
make clean
|
||||
|
||||
png:
|
||||
make
|
||||
make svg
|
||||
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||
|
||||
transparentGif:
|
||||
convert $(SOURCE).pdf -transparent white result.gif
|
||||
make clean
|
||||
|
||||
svg:
|
||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||
# Necessary, as pdf2svg does not always create valid svgs:
|
||||
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
|
33
tikz/x-3-cubic-function/x-3-cubic-function.tex
Normal file
33
tikz/x-3-cubic-function/x-3-cubic-function.tex
Normal file
|
@ -0,0 +1,33 @@
|
|||
\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}
|
Loading…
Add table
Add a link
Reference in a new issue