3

I am trying to produce the next figures: enter image description here enter image description here

I try with this code:

\begin{tikzpicture}
\begin{axis}[view={60}{20}]
\addplot3[surf,shader=flat,
samples=30,trig format=rad,
domain=1:0, y domain=0:2*pi,
z buffer=sort]
({((1-(x^2))^2)*cos(y)},
{((1-(x^2))^2)*sin(y)},x);
\end{axis}
\end{tikzpicture}

But I do not understand why it does not produce what I need.

2

Here is a proposal for the mesh only. The blue curve can be done, too, but is more involved.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{math}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={60}{20},unit vector ratio=1 1 0.5]
\addplot3[mesh,color=black,%surf,shader=flat,
samples=31,trig format=rad,
domain=0:2, y domain=0:2*pi,
z buffer=sort]
({x*cos(y)},
{x*sin(y)},{cos(x*pi)/(1+x*x)});
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • Thank you so much. Now it is working with small modifications to the code. – Alfredo Oct 16 '18 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.