我想绘制最小、最大、平均图。现在我想绘制两个相邻的条形图,它们具有相同的 x 值。现在我有以下代码:
\begin{tikzpicture}[scale=1.0]
\begin{axis} [
width = 0.32*\textwidth,
height = 6cm,
symbolic x coords={L1, L2, L1+SSIM},
xtick=data,
/pgf/number format/.cd,
use comma,
1000 sep={},
title style={yshift=1.5ex, font=\bfseries},
title={}
]
\addplot+[black, very thick, forget plot,only marks]
plot[very thick, error bars/.cd, y dir=plus, y explicit]
table[x=x,y=mean_mae,y error expr=\thisrow{best_mae}] {\mytable};
\addplot+[black, very thick, only marks,xticklabels=\empty]
plot[very thick, error bars/.cd, y dir=plus, y explicit]
table[x=x,y=mean_mae,y error expr=\thisrow{worst_mae}] {\mytable};
\addplot+[blue, very thick, forget plot,only marks]
plot[very thick, error bars/.cd, y dir=plus, y explicit]
table[x=x,y=mean_mae,y error expr=\thisrow{best_mae}] {\mytable};
\addplot+[blue, very thick, only marks,xticklabels=\empty, xshift=1mm]
plot[very thick, error bars/.cd, y dir=plus, y explicit]
table[x=x,y=mean_mae,y error expr=\thisrow{worst_mae}] {\mytable};
\end{axis}
\end{tikzpicture}
以此图作为结果:
但如您所见,它在黑线上方绘制了一条蓝线。但我想让它们彼此相邻。我可以在 \addplot 中添加类似 shift 的功能吗?