\resizebox{\linewidth}{!}{%
\begin{tikzpicture}
\begin{groupplot}[
    group style={
        group size=5 by 1,
        horizontal sep=0.8cm,
        x descriptions at=edge bottom,
        y descriptions at=edge left,
    },
    width=3cm,
    height=13cm,
    scale only axis,
    point meta min=0,
    point meta max=1,
    xtick=\empty,
    ytick=\empty,
    axis line style={draw=none},
    enlargelimits=false,
    xlabel={KV heads},
    ylabel={Layers},
    xlabel style={font=\small},
    ylabel style={font=\small},
    title style={yshift=2mm, font=\bfseries},
    colormap/viridis,
]

% Define your images and titles here
\nextgroupplot[title={(a) En.QA (main)}]
\addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1]{image/scbench_qa_eng-0.pdf};

\nextgroupplot[title={(b) DuoAttention}]
\addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1]{image/duo.pdf};

\nextgroupplot[title={(c) En.QA (sample-2)}]
\addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1]{image/scbench_qa_eng-1.pdf};

\nextgroupplot[title={(d) Code.RepoQA}]
\addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1]{image/scbench_repoqa-0.pdf};

\nextgroupplot[title={(e) Retr.KV}, 
    colorbar right,
    colorbar style={
        width=0.2cm,
        height=13cm,
        at={(1.1,0.5)},
        anchor=west,
        ytick={0,0.2,0.4,0.6,0.8,1},
        yticklabel style={
            /pgf/number format/.cd,
            fixed,
            precision=1,
            fixed zerofill,
        },
        tick style={draw=none}, % remove tick lines
        font=\footnotesize,
    },
]
\addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1]{image/scbench_kv-0.pdf};

\end{groupplot}
\end{tikzpicture}
}