我無法在以下 3D 繪圖的 MWE 中獲得可接受的定位刻度標籤乘數:
% !TeX program = lualatex
\RequirePackage{luatex85}
\documentclass[border=1pt]{standalone}
\usepackage{fontspec}
\usepackage{mathtools}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{
pgfplots.groupplots,
babel
}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{pgfplotstable}
\usepackage[main=ngerman,english]{babel}
\begin{document}
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
clip=false,
view={120}{45},
xmin=0,
xmax=0.01,
ymode=log,
ytick={0.01,0.1,1,10},
ymin=0,
ymax=100,
zlabel={C},
]
\addplot3 [surf,samples=4,domain=0:0.01, y domain=1:100] {x+y};
\node at (rel axis cs:0.5,0,1) [above,sloped like x axis] {A};
\node at (rel axis cs:0,0.5,1) [above,sloped like y axis] {B};
\end{axis}
\end{tikzpicture}
\end{document}
10^-2
看看刻度標籤乘數距離軸有多遠;
我想讓它在軸的另一端更接近甚至更好。
答案1
如果要變更刻度標籤的位置,請every x tick scale label/.style
根據需要變更 的條目。這是一個可能適合您需求的範例。
% used PGFPlots v1.15
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{
compat=1.15,
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=both,
clip=false,
view={120}{45},
xmin=0,
xmax=0.01,
ymode=log,
ytick={0.01,0.1,1,10},
ymin=0,
ymax=100,
zlabel={C},
% ---------------------------------------------------------------------
% added
every x tick scale label/.style={
at={(xticklabel* cs:-0.2)},
anchor=near xticklabel,
inner sep=0pt,
},
% ---------------------------------------------------------------------
]
\addplot3 [surf,samples=4,domain=0:0.01, y domain=1:100] {x+y};
\node at (rel axis cs:0.5,0,1) [above,sloped like x axis] {A};
\node at (rel axis cs:0,0.5,1) [above,sloped like y axis] {B};
\end{axis}
\end{tikzpicture}
\end{document}