\begin{tikzpicture}

\tikzstyle{h2o} = [or, mark=diamond, mark size=1pt]
\tikzstyle{snap} = [gr, mark=x, mark size=1.3pt]
\tikzstyle{pyramid} = [bl, mark=+, mark size=1.3pt]
\tikzstyle{prob} = [red, mark=*, mark size=0.7pt]

\begin{groupplot}[group style={columns=2, horizontal sep=1.2cm, vertical sep=1.2cm},
    width=5.0cm,
    height=4.0cm,
    every axis plot/.append style={thick},
    % Label
    xlabel shift=-0.08cm,         
    ylabel shift=-0.15cm,
    xlabel near ticks,
    ylabel near ticks,
    label style={font=\scriptsize},
    xlabel={KV cache ratio},
    ylabel={Rel. performance},
    % Grid
    grid=major,
    xmajorgrids=true,
    ymajorgrids=true,
    major grid style={dotted, black},
    % tick
    tick label style={font=\scriptsize},
    tick pos=left,
    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=0},
    xmax=1.0,
    xmin=0.1,
    xtick={0.2, 0.4, 0.6, 0.8, 1.0},
    extra x ticks={0.3, 0.5, 0.7, 0.9},   
    extra x tick labels={,,,},
    extra x tick style={
        grid=none,
        tick style={thin},
        major tick length=2.4pt,
    },    
    % title
    title style={
      at={(axis description cs:0.5,0.93)}, 
      anchor=south,
      font={\footnotesize}
    },    
]

%%%% Retrieval-Matching %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\nextgroupplot[title=Mix.RepoQA+KV, 
legend columns=4, legend style={at={(1.1,1.25)}, anchor=south, font=\footnotesize}, ylabel={Pass@1 \& Accuracy (\%)}, ytick distance=20
]
\addplot[prob] table[x=ratio, y=kv-repoqa-prob, col sep=comma]{data/qwen-7b-multi.csv};\addlegendentry{KVzip (ours)}
\addplot[h2o] table[x=ratio, y=kv-repoqa-h2o, col sep=comma]{data/qwen-7b-multi.csv};\addlegendentry{$\text{H}_2\text{O}$}
\addplot[snap] table[x=ratio, y=kv-repoqa-snap, col sep=comma]{data/qwen-7b-multi.csv};\addlegendentry{SnapKV}
\addplot[pyramid] table[x=ratio, y=kv-repoqa-pyramid, col sep=comma]{data/qwen-7b-multi.csv};\addlegendentry{PyramidKV}


\nextgroupplot[title=Mix.Sum+NIAH, ylabel={ROUGE \& Accuracy (\%)}, ytick distance=10]
\addplot[h2o] table[x=ratio, y=summ-needle-h2o, col sep=comma]{data/qwen-7b-multi.csv};
\addplot[snap] table[x=ratio, y=summ-needle-snap, col sep=comma]{data/qwen-7b-multi.csv};
\addplot[pyramid] table[x=ratio, y=summ-needle-pyramid, col sep=comma]{data/qwen-7b-multi.csv};
\addplot[prob] table[x=ratio, y=summ-needle-prob, col sep=comma]{data/qwen-7b-multi.csv};



\end{groupplot}
\end{tikzpicture}
