mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
added 3d function plot
This commit is contained in:
parent
89f853e2b0
commit
88c614a1a9
2 changed files with 72 additions and 0 deletions
41
tikz/3d-function-continuous/3d-function-continuous.tex
Normal file
41
tikz/3d-function-continuous/3d-function-continuous.tex
Normal file
|
@ -0,0 +1,41 @@
|
|||
\documentclass{article}
|
||||
\usepackage[pdftex,active,tightpage]{preview}
|
||||
\setlength\PreviewBorder{2mm}
|
||||
%\documentclass[varwidth=true, border=20pt]{standalone}
|
||||
%\documentclass{article}
|
||||
\usepackage{pgfplots}
|
||||
|
||||
\begin{document}
|
||||
\begin{preview}
|
||||
\pgfplotsset{
|
||||
colormap={whitered}{
|
||||
color(0cm)=(white);
|
||||
color(1cm)=(orange!75!red)
|
||||
}
|
||||
}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
colormap name=whitered,
|
||||
width=15cm,
|
||||
view={335}{50},
|
||||
enlargelimits=false,
|
||||
grid=major,
|
||||
domain=-2:2,
|
||||
y domain=-2:2,
|
||||
samples=55, %60 : TeX capacity exceeded, sorry [main memory size=3000000].
|
||||
xlabel=$x$,
|
||||
ylabel=$y$,
|
||||
zlabel={$z$},
|
||||
colorbar,
|
||||
colorbar style={
|
||||
at={(-0.1,0)},
|
||||
anchor=south west,
|
||||
height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
|
||||
title={$f(x,y)$}
|
||||
}
|
||||
]
|
||||
\addplot3[surf] {x*y*y/(x*x+y*y*y*y)};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{preview}
|
||||
\end{document}
|
31
tikz/3d-function-continuous/Makefile
Normal file
31
tikz/3d-function-continuous/Makefile
Normal file
|
@ -0,0 +1,31 @@
|
|||
SOURCE = 3d-function-continuous
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue