Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
1
\documentclass{article}
2
\usepackage[pdftex,active,tightpage]{preview}
3
\setlength\PreviewBorder{2mm}
4
\usepackage{pgfplots}
5
6
\begin{document}
7
\begin{preview}
8
\pgfplotsset{
9
colormap={whitered}{
10
color(0cm)=(white);
11
color(1cm)=(orange!75!red)
12
}
13
}
14
\begin{tikzpicture}
15
\begin{axis}[
16
colormap name=whitered,
17
width=15cm,
18
view={10}{65},
19
enlargelimits=false,
20
grid=major,
21
domain=-5:5,
22
y domain=-5:5,
23
samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
24
% see also http://tex.stackexchange.com/a/7954/5645
25
xlabel=$x$,
26
ylabel=$y$,
27
zlabel={$z$},
28
colorbar,
29
colorbar style={
30
at={(-0.1,0)},
31
anchor=south west,
32
height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
33
title={$f(x,y)$}
34
}
35
]
36
\addplot3[surf] {2*x*y/(x*x+y*y)};
37
\end{axis}
38
\end{tikzpicture}
39
\end{preview}
40
\end{document}
41
42