\begin{tikzpicture}
\pgfplotsset{
    colormap={mycustommap}{
        color(0cm)=(blue)    % at -6
        color(0.5cm)=(blue)    % at -6
        color(1.5cm)=(blue!50!yellow) 
        color(2.5cm)=(yellow)      % brightening at -2
        color(3.5cm)=(red!70!yellow) 
        color(5cm)=(red)   % top end (at 0)
    }
}

\begin{groupplot}[
    group style={
        group size=4 by 1,
        horizontal sep=1.05cm,
        vertical sep=0cm,
        ylabels at=edge left,
        xlabels at=edge bottom,
    },
    width=3.7cm,
    height=3.7cm,
    view={0}{90}, % top-down view
    enlargelimits=false,
    axis on top,
    point meta=explicit,
    shader=flat corner, % clean pixelated look
    % label
    xlabel shift=-0.12cm,         
    ylabel shift=-0.13cm,
    xlabel near ticks,
    ylabel near ticks,
    label style={font=\scriptsize},
    % Tick
    tick label style={font=\tiny},
    x tick label style={/pgf/number format/.cd, fixed, fixed zerofill, precision=1},
    y tick label style={/pgf/number format/.cd, fixed, fixed zerofill, precision=1},
    xtick style={thin},
    ytick style={thin},
    major tick length=1pt,
    xmin=0, xmax=1,
    ymin=0, ymax=1,
    %
    colormap name=mycustommap, 
    % colormap/hot, % Choose colormap
    point meta min=-5, 
    point meta max=0,  
    colorbar style={
        ytick={-5, -4, -3, -2, -1, -0},
        yticklabels={$10^{\shortminus5}$, $10^{\shortminus4}$, $10^{\shortminus3}$, $10^{\shortminus2}$, $10^{\shortminus1}$, $10^{0}$},
        yticklabel style={
            /pgf/number format/.cd,
            fixed,
            precision=0,  
            /tikz/.cd, % switch back to tikz scope
            font=\tiny, % adjust font size here
            xshift=-2pt,
        },        
        tick style={line width=0.4pt, major tick length=2pt}, % adjust tick size here
        width=0.2cm,
        at={(1.08,0.5)},
        anchor=west,
        font=\tiny,            
        },
]

\nextgroupplot[
    xlabel={Score (Repeat)},
    ylabel={Score (QA)},
]

\addplot [
    matrix plot*,
    mesh/cols=14, % <- crucial; replace accordingly
    point meta=explicit,
] table [
    col sep=comma,
    x=repeat-qa-x,
    y=repeat-qa-y,
    meta=repeat-qa-log
] {data/scatter.csv};


\nextgroupplot[
  xlabel={Score (Repeat)},
  ylabel={Score (Summarization)},
]
\addplot [
    matrix plot*,
    mesh/cols=14, % <- crucial; replace accordingly
    point meta=explicit,
] table [
    col sep=comma,
    x=repeat-qa-x,
    y=repeat-qa-y,
    meta=repeat-summ-log
] {data/scatter.csv};
    

\nextgroupplot[
  xlabel={Score (Repeat)},
  ylabel={Score (Reasoning)},
]
\addplot [
    matrix plot*,
    mesh/cols=14, % <- crucial; replace accordingly
    point meta=explicit,
] table [
    col sep=comma,
    x=repeat-qa-x,
    y=repeat-qa-y,
    meta=repeat-reason-log
] {data/scatter.csv};
    

\nextgroupplot[
  xshift=0.5cm,
  colorbar, % Show colorbar
  xlabel={Score (QA-1)},
  ylabel={Score (QA-2)},
]
\addplot [
    matrix plot*,
    mesh/cols=14, % <- crucial; replace accordingly
    point meta=explicit,
] table [
    col sep=comma,
    x=repeat-qa-x,
    y=repeat-qa-y,
    meta=qa-qa-log
] {data/scatter.csv};


\end{groupplot}

\draw[dashed] 
    ([xshift=0.45cm]group c3r1.north east) -- 
    ([xshift=0.45cm,yshift=-0.3cm]group c3r1.south east);

\draw[red, dashed] 
    ([xshift=-0.1cm,yshift=-0.06cm]group c1r1.south west) --
    ([xshift=0.06cm,yshift=0.1cm]group c1r1.north east) --
    ([xshift=0.06cm,yshift=-0.06cm]group c1r1.south east) -- cycle;

\draw[red, dashed, line width=0.6pt] 
    ([xshift=-0.06cm,yshift=-0.06cm]group c4r1.south west) rectangle 
    ([xshift=0.2cm,yshift=0.08cm]group c4r1.north west);

\end{tikzpicture}
