在下面的代码中,为什么 0 刻度标记不显示?
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{1}
\begin{tikzpicture}[scale=.9, transform shape]
\begin{axis}[axis lines=center,axis line style={black, thick,-latex},
tick style={line width=.04cm, color=black, line cap=round},
font=\normalsize,color=black,
xmin=0,xmax=64,
xtick={0,16,32},xticklabels={0,16,32},
ymin=0,ymax=16,
ytick={0,4,8},yticklabels={0,4,8},
tickwidth=.2cm,
xlabel={P}, xlabel style={right},
ylabel={M}, ylabel style={above},
xticklabel style={inner xsep=0cm, xshift=0cm,yshift=-.1cm},
yticklabel style={inner ysep=0cm,xshift=-.1cm,yshift=0cm},
samples=200]
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
答案1
因此,根据您的(神秘消失的)评论,您想要:
- 显示
0
刻度标签 - 不显示
0
刻度线 - 将轴标签放置在轴的末端
代码:
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{1}
\begin{tikzpicture}[scale=.9, transform shape]
\begin{axis}[
axis y line=left,
axis x line=bottom,
axis line style={black, thick,-latex},
tick style={line width=.04cm, color=black, line cap=round},
font=\normalsize,
color=black,
xmin=0,
xmax=64,
xtick={16,32},
extra x ticks = {0},
extra y ticks= {0},
extra tick style={tick style={draw=none}},
ymin=0,
ymax=16,
ytick={4,8},
tickwidth=.2cm,
xlabel={P},
every axis x label/.style={
at = {(ticklabel* cs:1)},
anchor = west
},
ylabel={M},
every axis y label/.style={
at = {(ticklabel* cs:1)},
anchor = south
},
xticklabel style={inner xsep=0cm, xshift=0cm,yshift=-.1cm},
yticklabel style={inner ysep=0cm,xshift=-.1cm,yshift=0cm},
samples=200
]
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
结果: