CoCalc Public Filestmp / 3d.texOpen in with one click!
Author: William A. Stein
1
\documentclass{article}
2
\usepackage{sagetex}
3
\begin{document}
4
\begin{sageblock}
5
var('x,y')
6
f1(x,y) = (x^2 - y^2)
7
zmin, zmax = -2,2
8
cm = colormaps.Spectral
9
def c(x,y): return float((f1(x,y)-zmin)/(zmax-zmin))
10
S1= plot3d(f1, (x,-1.5,1.5), (y,-1.5,1.5),color=(c,cm),
11
frame = False)
12
\end{sageblock}
13
14
And the figure
15
16
\sageplot[scale =1, trim = {3cm, 4cm, 0cm, 5cm}, clip]{S1}
17
\end{document}