\definecolor{blue}{RGB}{42, 179, 205}
\definecolor{green}{RGB}{250, 231, 35}
\definecolor{orange}{RGB}{253, 127, 116}
\definecolor{red}{RGB}{150, 55, 173}

\begin{tikzpicture}
\begin{groupplot}[
    group style={group size=5 by 1, horizontal sep=0.75cm, vertical sep=1.5cm},
    width=3.65cm, height=4cm,
    xlabel={},
    xtick={}
    legend style={font=\small},
    legend pos=north east,
    grid=major
    % ymin=0.7, ymax=0.85 % Adjust according to your data
]

% Example plots
\nextgroupplot[
            title={\scriptsize Bias Field},
            % xlabel={Severity},
            ylabel={\scriptsize ACDC \\ \scriptsize DSC},
            ylabel style={align=center},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_BiasField.csv};
    
    \nextgroupplot[
            title={\scriptsize Ghosting},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_Ghosting.csv};


    \nextgroupplot[
            title={\scriptsize k-Space Sub.},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_KSpaceSubsampling.csv};


    \nextgroupplot[
            title={\scriptsize Rician Noise},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_RicianNoise.csv};


    \nextgroupplot[
            title={\scriptsize Spike Noise},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/acdc/pgf_format_corruption_trends_SpikeNoise.csv};
\end{groupplot}
\end{tikzpicture}

\centering
\begin{tikzpicture}
\begin{groupplot}[
    group style={group size=5 by 1, horizontal sep=0.75cm, vertical sep=1.5cm},
    width=3.65cm, height=4cm,
    xlabel={\scriptsize Severity},
    legend style={font=\small},
    legend pos=north east,
    grid=major
    % ymin=0.7, ymax=0.85 % Adjust according to your data
]

% Example plots
\nextgroupplot[
            % title={\scriptsize BiasField},
            % xlabel={Severity},
            ylabel={\scriptsize P158 \\ \scriptsize DSC},
            ylabel style={align=center},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*, mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
            % legend style={at={(0.5,1.1)}, anchor=north, legend columns=-1}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_BiasField.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_BiasField.csv};
        % \legend{Model A, Model B, Model C, Model D}
    
    \nextgroupplot[
            % title={\scriptsize Ghosting},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_Ghosting.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_Ghosting.csv};

    \nextgroupplot[
            % title={\scriptsize KSpaceSubsampling},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_KSpaceSubsampling.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_KSpaceSubsampling.csv};

    \nextgroupplot[
            % title={\scriptsize RicianNoise},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_RicianNoise.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_RicianNoise.csv};

    \nextgroupplot[
            % title={\scriptsize SpikeNoise},
            % xlabel={Severity},
            xtick={0,1,2,3,4,5},
            xticklabel style={font=\scriptsize},
            yticklabel style={font=\scriptsize},
            cycle list={{blue,mark=square*,mark size=1pt},{orange,mark=triangle*},{green,mark=diamond*},{red,mark=x},{gray,mark=*,mark size=1pt}}
        ]
        \addplot table [x=Severity, y=A, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=B, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=C, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=D, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_SpikeNoise.csv};
        \addplot table [x=Severity, y=N, col sep=comma] {pgfplots/p158/pgf_format_corruption_trends_SpikeNoise.csv};
\end{groupplot}
\end{tikzpicture}
\centering
\begin{tikzpicture}
    \begin{customlegend}[legend columns=-1,legend style={draw=none,column sep=1ex},legend entries={\scriptsize No Aug., \scriptsize Base, \scriptsize + MixUp, \scriptsize + AFA, \scriptsize + MixUp + AFA}]
    \addlegendimage{gray,fill=gray,mark=*}
    \addlegendimage{blue,fill=blue!30!white,mark=square*}
    \addlegendimage{green,fill=green,mark=diamond*}
    \addlegendimage{orange,fill=orange,mark=triangle*}
    \addlegendimage{red,fill=red,mark=x}
    \end{customlegend}
\end{tikzpicture}%

