2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-29 15:57:57 +02:00

added some more examples

This commit is contained in:
Martin Thoma 2012-12-20 19:45:49 +01:00
parent a40c94463e
commit ccfac9c458
6 changed files with 237 additions and 0 deletions

View file

@ -0,0 +1,40 @@
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{pgfplots}
\begin{document}
\begin{preview}
\pgfplotsset{
colormap={whitered}{
color(0cm)=(white);
color(1cm)=(orange!75!red)
}
}
\begin{tikzpicture}
\newcommand{\Pages}{250}
\begin{axis}[
colormap name=whitered,
width=15cm,
view={20}{25},
enlargelimits=false,
grid=major,
domain=0:\Pages,
y domain=1:\Pages,
samples=16,
xlabel=$p$,
ylabel=$C$,
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] {(\Pages!/(x!*(\Pages-x)!)) * (1/y)^x * (1-1/y)^(\Pages-x)};
\end{axis}
\end{tikzpicture}
\end{preview}
\end{document}

View file

@ -0,0 +1,31 @@
SOURCE = 3d-page-conflicts
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