tikz 软件包错误:放弃此路径。您忘记了分号吗?\end{axis}

tikz 软件包错误:放弃此路径。您忘记了分号吗?\end{axis}
                \begin{tikzpicture}
                    \begin{axis}[%
                        axis equal,
                        width=8in,
                        height=8in,
                        axis lines = center,
                        xlabel = {$x$},
                        ylabel = {$y$},
                        zlabel = {$z$},
                        xmax=5,
                        ymax=5,
                        zmax=6,
                        ticks=none,
                        enlargelimits=0.3,
                        view={135}{45},
                        scale uniformly strategy=units only,
                    ]
                        \addplot3[%
                            opacity = 0.5,
                            surf,
                            z buffer = sort,
                            samples = 21,
                            variable = \u,
                            variable y = \v,
                            domain = 0:5,
                            y domain = 0:360,
                        ]
                            (u*cos v,u*sin v,sqrt(25-u*u) );
                    \end{axis}
                \end{tikzpicture}

答案1

您的平方根括号过早终止了命令。您需要通过括号将其隐藏

(u*cos v,u*sin v,{sqrt(25-u*u)} );

相关内容