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/3d-page-conflicts/3d-page-conflicts.tex
2012-12-20 19:45:49 +01:00

40 lines
883 B
TeX

\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}