在 x 轴的最后一个刻度处添加一个加号

在 x 轴的最后一个刻度处添加一个加号

这是一个 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}

相关内容