在条形图中重复轴标签

在条形图中重复轴标签

使用以下内容latex

\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\begin{axis}
[
    ybar,
    nodes near coords,
    bar width=0.4cm,
    symbolic x coords={2--3 times a week, 4--6 times a week, Daily, Less than once a week, Once a week},
    enlarge x limits=0.5,
            xytick distance=1,       % <-- added
    width=12cm, % Adjust the width of the tikzpicture
    height=6cm, % Adjust the height of the tikzpicture
    scale only axis, % Scale only the axis and not the whole picture
    scale fonts=0.8, % Adjust the scale factor to make the fonts smaller
    tick label style={
        /pgf/number format/assume math mode=true, % Assume math mode for tick labels to prevent font size errors
        font=\tiny, % Adjust the font size of tick labels
        text width=1.8cm, % Adjust the width of each tick label
        align=center, % Center the text within each tick label
        inner xsep=0pt, % Remove horizontal padding within each tick label
    },
    label style={font=\tiny}, % Adjust the font size of axis labels
    legend style={font=\tiny}, % Adjust the font size of the legend
]
\addplot coordinates{(2--3 times a week,8)(4--6 times a week,5)(Daily,1)(Less than once a week,4)(Once a week,1)};
\end{axis}
\end{tikzpicture}
\caption{Frequency of an Activity}
\label{fig:frequency}
\end{figure}

我得到了以下图表,其中有一些重复的标签:在此处输入图片描述

我怎样才能除去它们?

相关内容