% and store the number of columns in `\NoOfCols'
% (minus 1 because counting in `\foreach' starts with zero
% \pgfplotstablegetcolsof{\loadedtable}
% \pgfmathtruncatemacro{\NoOfCols}{\pgfplotsretval-1}
% \NoOfCols

\begin{tikzpicture}[baseline]
    \pgfplotstableread[col sep=comma]{./data/ood_label_metrics.csv}{\loadedtable};
    
    \begin{axis}[
        % adjust the `width' a bit by keeping the default `height'
        width=\columnwidth,
        height=0.6\columnwidth,
        title={Normalized NLL ($\downarrow$) on label shift},
        ymin=-0.05,
        ymax=0.4,
        % there should be no gap between the bars in one group
        ybar=0pt,
        % adjust the size of the bars so they don't overlap
        bar width=0.85/5, % divided by number of columns
        % enlarge the x limits so all of the bars are shown
        enlarge x limits={abs=0.6},
        xtick={0, 1, 2, 3, 4}, % Define the desired y tick positions
        xticklabels={, , , , },
        legend style={font=\tiny, 
    	% fill opacity=0.6, text opacity =1,
            at={(0.02, 0.98)},anchor=north west,
            row sep=-3pt,
        },
        legend cell align={left},
    ]

        % GP-ARD-Laplace
        \addplot[fill=darkblue,
            error bars/.cd,
            x dir=both,x explicit,
            y dir=both,y explicit,
            error bar style={solid}] table [
                x expr=\coordindex,
                y index=16, % zero based
                y error index=66,
                col sep=comma,
        ] {\loadedtable};

        % GP-RFM-Laplace
        \addplot[fill=black,
            error bars/.cd,
            x dir=both,x explicit,
            y dir=both,y explicit,
            error bar style={solid}] table [
                x expr=\coordindex,
                y index=26,
                y error index=76,
                col sep=comma,
        ] {\loadedtable};

        % GP-RFM-Laplace-diag
        \addplot[fill=blackgray,
            error bars/.cd,
            x dir=both,x explicit,
            y dir=both,y explicit,
            error bar style={solid}] table [
                x expr=\coordindex,
                y index=31,
                y error index=81,
                col sep=comma,
        ] {\loadedtable};


        % NGBoost
        \addplot[fill=orange,
            error bars/.cd,
            x dir=both,x explicit,
            y dir=both,y explicit,
            error bar style={solid}] table [
                x expr=\coordindex,
                y index=36,
                y error index=86,
                col sep=comma,
        ] {\loadedtable};

        % CatBoost-Ensemble
        \addplot[fill=red,
            error bars/.cd,
            x dir=both,x explicit,
            y dir=both,y explicit,
            error bar style={solid}] table [
                x expr=\coordindex,
                y index=41,
                y error index=91,
                col sep=comma,
        ] {\loadedtable};

        % \legend{
        %     % {GP-RBF},
        %     % {GP-Laplace},
        %     % {GP-ARD-RBF},
        %     {GP-ARD-Laplace},
        %     {\textbf{GP-RFM-Laplace}}, 
        %     {NGBoost},
        %     {CatBoost-Ensemble}
        % }
    \end{axis}
\end{tikzpicture}