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
\pgfplotsset{compat=1.9}
6
7
\begin{document}
8
\begin{preview}
9
\pgfplotsset{
10
colormap={whitered}{
11
color(0cm)=(white);
12
color(1cm)=(orange!75!red)
13
}
14
}
15
\begin{tikzpicture}[scale=0.5]
16
\begin{axis}[
17
colormap name=whitered,
18
width=6cm,
19
view={155}{45},
20
enlargelimits=false,
21
grid=major,
22
domain=-5:5,
23
y domain=-5:5,
24
samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
25
% see also http://tex.stackexchange.com/a/7954/5645
26
xlabel=$x$,
27
ylabel=$y$,
28
zlabel={$z$},
29
colorbar,
30
colorbar style={
31
at={(-0.1,0)},
32
anchor=south west,
33
height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
34
title={$f(x,y)$}
35
}
36
]
37
\addplot3[surf] {y*y-x*x*x};
38
\end{axis}
39
\end{tikzpicture}
40
\end{preview}
41
\end{document}
42
43