如何隐藏轴线并留下轴标签?

如何隐藏轴线并留下轴标签?

我想隐藏黑匣子,但不隐藏x axis和的标签y axis

在此处输入图片描述

我使用的代码是:

\begin{tikzpicture}
\begin{axis}[
    ybar stacked, ymin=0,
    %width=\textwidth,
    height=6cm,
    enlargelimits=0.05,
    legend style={at={(0.5,-0.20)},
    anchor=north,legend columns=-1},
    symbolic x coords={F-Pa-Pr,F-Pa-S,4-Pa-Pr,5-Pa-Pr,6-Pa-Pr,7-Pa-Pr,4-Pa-S,5-Pa-S,6-Pa-S,7-Pa-S},
    xtick=data,
    x tick label style={rotate=45, anchor=east},
    legend image code/.code={\draw[#1, draw=none] (0cm,-0.1cm) rectangle (0.6cm,0.1cm);},
    legend style={area legend,
        at={(0.5,-0.3)},
        anchor=north,
        legend columns=4,
        draw=none,
        /tikz/every even column/.append style={column sep=1.0cm}}]]
    %\addplot table[x=Sample, y=C] {CHNSb.dat};
    %\addplot table[x=Sample, y=H] {CHNSb.dat};
    %\addplot table[x=Sample, y=N] {CHNSb.dat};
    %\addplot table[x=Sample, y=O] {CHNSb.dat};
    \legend{Carbon, Hydrogen, Nitrogen, Oxygen}
\end{axis}
\end{tikzpicture}

答案1

您可以通过将以下内容添加到轴选项来更改周围框和刻度的颜色:

every outer x axis line/.append style={white},
every tick/.append style={white},

在此处输入图片描述

相关内容