
Estou com esse problema em um gráfico, preciso fazer exatamente assim, mas a marca de salto do meio começa no tick, gostaria que cobrisse toda a barra como faz com as outras. A única solução que consegui pensar é adicionar a primeira e a última barras vazias, mas ainda não sei como tornar o nó e as barras invisíveis.
\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}
ficarei grato se você puder me ajudar. Mas não sou muito especialista em pgf...
Obrigado
Aqui está um exemplo simplificado:
\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}
de qualquer forma, encontrei a solução sozinho (acho que estava cansado...) substituindo "jump mark mid" por uma marca de linha simples
only marks, mark=-, mark size=16,
Responder1
apenas para fechar a postagem .. a solução óbvia que funcionou para mim foi usar uma marca de linha simples em vez de uma marca de salto no meio. substituindo
jump mark mid,
com
only marks, mark=-, mark size=16,