将轴标签定位到 3D 轴的末端

将轴标签定位到 3D 轴的末端

我如何定位轴标签,以使其看起来像下图(在轴的末端,就好像它是轴的延伸):

在此处输入图片描述

\pgfplotsset{
    every non boxed x axis/.style={
        xtick align=center,
        tick style={line width=1pt, color=black},
        x axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        xlabel style={at={(ticklabel* cs:1.05)}, anchor=west},
        xlabel=$x$
    },
     every non boxed y axis/.style={
        ytick align=center,
        tick style={line width=1pt, color=black},
        y axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        ylabel style={at={(ticklabel* cs:1.05)}, anchor=south},
        ylabel=$y$
    },
    every non boxed z axis/.style={
        ztick align=center,
        tick style={line width=1pt, color=black},
        z axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        zlabel style={at={(ticklabel* cs:1.05)},anchor=west},
        zlabel=$z$
    },
    tick label style={
        font=\tiny,
    }
}       

答案1

有了可兼容的文档,您将有更多机会获得答案(以 开头\documentclass并以 结尾\end{document}

通过修改锚点,我们可以定位标签。文档17.5.1 Positioning Nodes Using Anchors中的部分。pgfmanual

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta}
\begin{document}
\pgfplotsset{
    every non boxed x axis/.style={
        xtick align=center,
        tick style={line width=1pt, color=black},
        x axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        % xlabel style={at={(ticklabel* cs:1.05)}, anchor=west},
        xlabel style={at={(ticklabel* cs:1.05)}, anchor=north},
        xlabel=$x$
    },
    every non boxed y axis/.style={
        ytick align=center,
        tick style={line width=1pt, color=black},
        y axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        % ylabel style={at={(ticklabel* cs:1.05)}, anchor=south},
        ylabel style={at={(ticklabel* cs:1.05)}, anchor=west},
        ylabel=$y$
    },
    every non boxed z axis/.style={
        ztick align=center,
        tick style={line width=1pt, color=black},
        z axis line style={{Latex[width=1.5mm]}-{Latex[width=1.5mm]},black,line width=1.5pt},
        % zlabel style={at={(ticklabel* cs:1.05)},anchor=west},
        zlabel style={at={(ticklabel* cs:1.05)},anchor=south},
        zlabel=$z$
    },
    tick label style={
        font=\tiny,
    }
}    
\begin{tikzpicture}
    \begin{axis}[axis lines=center,view/h=100]
        \addplot3 coordinates {
            (1,1,1) 
            };
    \end{axis}
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容