y 轴中间的跳转标记在 x 刻度处开始和结束,并且仅覆盖第一轴和最后一轴的一半

y 轴中间的跳转标记在 x 刻度处开始和结束,并且仅覆盖第一轴和最后一轴的一半

我在图形上遇到了这个问题,我需要完全按照这个方法操作,但跳转标记中间从刻度开始,我希望它能像其他条一样覆盖整个条。我能想到的唯一解决方案是添加第一个和最后一个空条,但我仍然不知道如何使节点和条不可见。这是代码

\begin{tikzpicture}
\begin{axis}[width=\textwidth,height=10cm,
legend entries={Nord, Sud, Est, Ovest, Media},
%ylabel={\%},
symbolic x coords={Alimentari,Gastronomie,Macellerie,Discount,Ipermercati,Supermercati~grandi,Supermercati~piccoli,Ingrossi,Altro},
every node near coord/.style={font=\large },
every node near coord/.append style={yshift=1mm,
/pgf/number format/fixed,
/pgf/number format/precision=1
},
x tick label style={rotate=45,anchor=east},
ymin=-1,
xtick pos=left,
ytick pos=left
]
\addplot[jump mark mid, blue, very thick, line legend] table[x={esercizio}, y={Nord}] {scostamentotipoes.dat};
\addplot[jump mark mid,red, very thick, line legend] table[x={esercizio}, y={Sud}] {scostamentotipoes.dat};
\addplot[jump mark mid,green, very thick, line legend] table[x={esercizio}, y={Est}] {scostamentotipoes.dat};
\addplot[jump mark mid,yellow, very thick, line legend] table[x={esercizio}, y={Ovest}] {scostamentotipoes.dat};
\addplot[ybar,bar width=30, black, very thick, area legend, nodes near coords={\pgfmathprintnumber\pgfplotspointmeta\%}] table[x={esercizio}, y={Media}] {scostamentotipoes.dat};
\end{axis}
\end{tikzpicture}

如果你能帮助我,我将不胜感激。不过我对 pgf 不是很了解... 图形图像 谢谢

这是一个简单的例子:

\documentclass{article}
\usepackage{graphicx}
\usepackage{pgfplots}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
legend entries={subset, mean},
symbolic x coords={A,B,C},
xtick pos=left,
ytick pos=left,
ymin=0,
]
\addplot[
jump mark mid,
blue, very thick, line legend] coordinates{(A,1) (B,2) (C,1.5)};
\addplot[ybar,bar width=30, black, very thick, area legend, nodes near coords={\pgfmathprintnumber\pgfplotspointmeta\%}] coordinates{(A,2) (B,3) (C,1)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

无论如何,我自己找到了解决方案(我想我只是累了......)通过用简单的线标记替换“跳跃标记中间”

only marks, mark=-, mark size=16,

答案1

只是为了关闭帖子。对我来说,最明显的解决办法是使用简单的线条标记而不是中间的跳跃标记。替换

jump mark mid,

only marks, mark=-, mark size=16,

相关内容