3D 图中的 Z 轴位置

3D 图中的 Z 轴位置

我可能错过了pgfplots.sourceforge但是我怎样才能将其z axis定位为红色而不是在前面呢?

在此处输入图片描述

平均能量损失

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\pgfplotsset{colormap={whitered}{color(0cm)=(white!20!orange); color(2.5cm)=(orange!75!red)}}
    \begin{document}
    \begin{tikzpicture}
        \begin{axis}[
    view={-30}{30},
    axis lines=center,  %% of course it's not center i need.
    axis on top,
    axis line style={black!40},
    xlabel style ={sloped},
    ylabel style ={sloped},
    ticklabel style={font=\small},
    samples=31]

    \addplot3 [surf,opacity=0.2]    {exp(-x^2-y^2)};
        \end{axis}
    \end{tikzpicture} 
    \end{document}

答案1

使用axis lines=left而不是axis lines=center

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}

\pgfplotsset{compat=1.17}

\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={group size=3 by 2, vertical sep=10ex,  horizontal sep=6ex},
view={-30}{30},
axis lines=left,  
axis on top,
axis line style={black!40},
xlabel style ={sloped},
ylabel style ={sloped},
ticklabel style={font=\small},
domain=50:150,
y domain=0.01:1, 
samples=11]
\nextgroupplot
\addplot3[samples y=0,samples=101,domain=0:3] ({1+cos(200*x)},{1+sin(200*x)},x);
\end{groupplot}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容