如何移除轴但标签应该在那里
例如:电流输出
预期输出
我正在使用以下代码
\documentclass{standalone}
\usepackage{mathtools}
\usepackage{pgfplots}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=3,
ymin=0,ymax=3,xstep=1,ystep=1,
xtick={0,...,3},
ytick={0,...,3},
axis y line*=left,
axis x line*=bottom,
xlabel={$p_0$ (psi)},
xlabel near ticks,
ylabel near ticks,
]
\end{axis}
\end{tikzpicture}
\end{document}
答案1
axis line style={draw=none}
在选项中设置axis
。若要同时删除勾选,请tick style={draw=none}
另外添加。
在旧版本中,轴线的pgfplots
方法draw=none
不起作用,但可以将不透明度设置为零:axis line style={draw opacity=0}
,或者可以分别针对 x 轴和 y 轴,y axis line style={draw opacity=0}, x axis line style={draw opacity=0}
。(参见注释。)
\documentclass{standalone}
\usepackage{mathtools}
\usepackage{pgfplots}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=3,
ymin=0,ymax=3,xstep=1,ystep=1,
xtick={0,...,3},
ytick={0,...,3},
axis y line*=left,
axis x line*=bottom,
xlabel={$p_0$ (psi)},
xlabel near ticks,
ylabel near ticks,
axis line style={draw=none},
tick style={draw=none}
]
\end{axis}
\end{tikzpicture}
\end{document}