[Tex/LaTex] PGFPlots error “Dimension too large” when plotting .csv data

csverrorspgfplotstables

I did search on here for a solution and I did read the manual, but i couldn't find an answer (or at least one that I understood).

I am plotting some data in a .csv file and for some reason when the x axis value goes above 930.08 it gives the error "Dimension too large". What is strange, though, I have other data that does exceed 930.08 and that works fine, although it starts at 800, not 930 – this "erroneous" data is essentially a segment of larger data range but each sample is at a smaller samplerate (original data: start=800, increment=0.25, end= 1100, new data: start=930, increment: 0.01, end=960).

The data which gives the error is

a,b,c
930.00,0.0001095886,0.03875491
930.01,0.0001499818,0.0448156
930.02,0.0001117049,0.03977829
930.03,0.0001122457,0.03972992
930.04,0.0001595432,0.04589581
930.05,9.773631e-05,0.03843789
930.06,0.0001590169,0.04583743
930.07,0.000153542,0.04522526
930.08,9.953637e-05,0.03739852

The data before 930.08 doesn't give the errors.

The code I am using to plot the graph is:

\begin{center}
    \begin{tikzpicture}
        \begin{loglogaxis}[black,
            width=14cm,
            height=10cm,
            mark=none,
            xlabel=Scaling Factor,
            transpose legend,
            legend style={at={(0.5,-0.15)},anchor=north},
            legend entries={MSE, Accuracy},
            legend style={nodes=right}]

            \addplot[no markers,blue] table [x=a, y=b, col sep=comma,] {
                ./chapter4/refined2b.csv
            };
            \addplot[no markers,red] table [x=a, y=c, col sep=comma,] {
                ./chapter4/refined2b.csv
            };
        \end{loglogaxis}
    \end{tikzpicture}
\end{center}

Many thanks to anyone who responds.

Best Answer

Possibly having very little steps in the x coordinates forces pgfplots to the numerical accuracy limits. Instead using the logarithmic axes for y and linear for x works without any problem.

\begin{semilogyaxis}[black,
    width=14cm,
    height=10cm,
    mark=none,
    xlabel=Scaling Factor,
    transpose legend,
    legend style={at={(0.5,-0.15)},anchor=north},
    legend entries={MSE, Accuracy},
    legend style={nodes=right}]

    \addplot[no markers,blue] table [x=a, y=b, col sep=comma,] {
        ./chapter4/refined2b.csv
    };
    \addplot[no markers,red] table [x=a, y=c, col sep=comma,] {
        ./chapter4/refined2b.csv
    };
\end{semilogyaxis}