这是一个 MWE。
\begin{tikzpicture}[scale=0.92]
\begin{axis}[
xmax=100,xmin=0,
ymin=0,ymax=1,
xlabel=\emph{x axis},ylabel=\emph{y axis},
xtick={0,10,20,...,100},
ytick={0,0.1,0.2,...,1},
]
\addplot+ [mark=pentagon*,mark size=2.5pt,every mark/.append style={}] coordinates{(0,1.0) (10,0.93) (20,0.86) (30,0.81) (40,0.77)
(50,0.69) (60,0.60) (70,0.53) (80,0.45) (90,0.38) (100,0.32)};
\addplot coordinates{(0,1.0) (10,0.89) (20,0.80) (30,0.72) (40,0.63)
(50,0.53) (60,0.46) (70,0.37) (80,0.28) (90,0.18) (100,0.11)};
\legend{\emph{series 1},\emph{series 2}}
\end{axis}
\end{tikzpicture}
答案1
xticklabels
像这样设置:
xtick={0,10,20,...,100},
xticklabels={0,10,20,...,90,100+},
\documentclass[border=3mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[scale=0.92]
\begin{axis}[
xmax=100,xmin=0,
ymin=0,ymax=1,
xlabel=\emph{x axis},ylabel=\emph{y axis},
xtick={0,10,20,...,100},
xticklabels={0,10,20,...,90,100+},
ytick={0,0.1,0.2,...,1},
]
\addplot+ [mark=pentagon*,mark size=2.5pt,every mark/.append style={}] coordinates{(0,1.0) (10,0.93) (20,0.86) (30,0.81) (40,0.77)
(50,0.69) (60,0.60) (70,0.53) (80,0.45) (90,0.38) (100,0.32)};
\addplot coordinates{(0,1.0) (10,0.89) (20,0.80) (30,0.72) (40,0.63)
(50,0.53) (60,0.46) (70,0.37) (80,0.28) (90,0.18) (100,0.11)};
\legend{\emph{series 1},\emph{series 2}}
\end{axis}
\end{tikzpicture}
\end{document}