1

Draw a paraboloid $z=x^2-y^2$. The code is given below:

Problem: 1. I want the surface transparent as given by A hyperbolic triangle embedded in a saddle-shaped surface or https://tikz.net/paraboloid/. I don't need a grid type surface.

  1. Please correct the axes. I want the triad from (0,0,0) such that they have arrows at the end.

  2. If possible, suggest how to give proper shade of color on the surface.

    \documentclass[tikz,border=5pt]{standalone}
     \usepackage{pgfplots}
    \pgfplotsset{compat=1.15}
     \begin{document}
     \begin{tikzpicture}
    \begin{axis}[
                grid=none,
                axis lines=none,
                inner axis line style={=>},
                ticks=none]
                \addplot3 [draw=black,line width=2pt,samples y=0] ({x},0,{x*x});
                \addplot3 [draw=black,line width=2pt,samples y=0] (0,{x},{-x*x});
                \addplot3 [surf,shader=flat,fill opacity=.4,draw=black] {x*x-y*y};
                \draw[->] (0,0,0) -- (10,0,0);
                \draw[->] (0,0,0) -- (0,10,0);
                \draw[->] (0,0,0) -- (0,0,10);
    \end{axis}
    \end{tikzpicture}
    \end{document}

1 Answers1

0

In pgfplots'documentation we can read

The shader=interp key activates a smooth color interpolation.

\documentclass[tikz,border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}%<-- last version
\begin{document}
\begin{tikzpicture}
\begin{axis}[
          grid=none,
          axis lines=none,
          inner axis line style={=>},
          ticks=none]
          \addplot3 [draw=black,line width=2pt,samples y=0] ({x},0,{x*x});
          \addplot3 [draw=black,line width=2pt,samples y=0] (0,{x},{-x*x});
          \addplot3 [
              surf,
              % shader=flat,
              shader=interp,
              fill opacity=.4,
              draw=black
            ] {x*x-y*y};
          \draw[->] (0,0,0) -- (10,0,0);
          \draw[->] (0,0,0) -- (0,10,0);
          \draw[->] (0,0,0) -- (0,0,10);
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

pascal974
  • 4,652