📚 The CoCalc Library - books, templates and other resources
License: OTHER
\documentclass[varwidth=true, border=2pt]{standalone}12\usepackage[usenames,dvipsnames]{xcolor}3\usepackage{pgfplots}4\pgfplotsset{compat=1.13}5\usetikzlibrary{arrows.meta}67\begin{document}8\pgfplotsset{9colormap={whitered}{10color(0.000cm)=(blue!50!black);11color(0.125cm)=(blue);12color(0.250cm)=(SkyBlue);13color(0.375cm)=(SkyBlue);14color(0.500cm)=(SpringGreen);15color(0.625cm)=(yellow);16color(0.750cm)=(yellow);17color(0.875cm)=(red);18color(1.000cm)=(red!50!black)19}20}21\begin{tikzpicture}22\begin{axis}[23domain=-2:2,24view={0}{90},25axis background/.style={fill=white},26xmin=-2, xmax=2,27ymin=-2, ymax=2,28axis equal image,29point meta rel=per plot30]31\addplot3[surf,32samples=50,33shader=interp,34colormap name=whitered]35{x/exp(x^2+y^2)};36% \addplot3[contour gnuplot={number=15, labels=false},37% very thick,38% samples=30]39% {x/exp(x^2+y^2)};40\addplot3[blue,41point meta={42sqrt(43((1-2*x^2)*exp(-x^2-y^2))^2+44(-2*x*y*exp(-x^2-y^2))^245)46},47quiver={48u={(1-2*x^2)*exp(-x^2-y^2)},49v={-2*x*y*exp(-x^2-y^2)},50scale arrows=0.3,51every arrow/.append style={%52-{Latex[scale length={max(0.01,\pgfplotspointmetatransformed/1000)}]},53},54},55samples=15]56{x/exp(x^2+y^2)};57\end{axis}58\end{tikzpicture}59\end{document}6061