diff --git a/tikz/3d-gradient-cos/3d-gradient-cos.png b/tikz/3d-gradient-cos/3d-gradient-cos.png new file mode 100644 index 0000000..5b9a979 Binary files /dev/null and b/tikz/3d-gradient-cos/3d-gradient-cos.png differ diff --git a/tikz/3d-gradient-cos/3d-gradient-cos.tex b/tikz/3d-gradient-cos/3d-gradient-cos.tex new file mode 100644 index 0000000..ab8016c --- /dev/null +++ b/tikz/3d-gradient-cos/3d-gradient-cos.tex @@ -0,0 +1,47 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} +\usepackage{pgfplots} +\usepgfplotslibrary{patchplots} + +\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={45}{45}, + enlargelimits=false, + grid=major, + domain=-90:90, + y domain=-90:90, + % ymode=log, + samples=46, %57 : TeX capacity exceeded, sorry [main memory size=3000000]. + % see also http://tex.stackexchange.com/a/7954/5645 + % zlabel=f, + %colorbar, + %colorbar style={ + % at={(-0.1,0)}, + % anchor=south west, + % height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height}, + % title={$f(x,y)$} + %} + ] + %\addplot3[patch,patch type=bilinear,mesh,black] {0}; + \addplot3[blue,/pgfplots/quiver, + quiver/u=4 * sin(x) * cos(x) * (cos(x)^2 + cos(y)^2), + quiver/v=4 * sin(y) * cos(y) * (cos(x)^2 + cos(y)^2), + quiver/w=0, + quiver/scale arrows=4, + -stealth,samples=15] {-4}; + \addplot3[surf,opacity=0.9] {-(cos(x)^2 + cos(y)^2)^2}; + \end{axis} +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/3d-gradient-cos/Makefile b/tikz/3d-gradient-cos/Makefile new file mode 100644 index 0000000..4720ea7 --- /dev/null +++ b/tikz/3d-gradient-cos/Makefile @@ -0,0 +1,35 @@ +SOURCE = 3d-gradient-cos +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +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: + make + #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 + rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg + inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg + rm $(SOURCE)2.svg diff --git a/tikz/3d-gradient-cos/README.md b/tikz/3d-gradient-cos/README.md new file mode 100644 index 0000000..5f93d9d --- /dev/null +++ b/tikz/3d-gradient-cos/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](3d-gradient-cos.png)