大数据的 pgfplots:维度太大

大数据的 pgfplots:维度太大

我正在尝试绘制一个大数据文件http://www.warcomeb.it/private/load.csv.zip使用以下代码:

    \documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{/pgf/number format/use comma,compat=1.12}


\begin{document}


\begin{tikzpicture}
    \begin{axis}[
        xmin = 0,
%       xmax = 25000,
        ymin = 0,
        ymax = 60,
        width=19cm,
%       xtick={0,2500,5000},
%       xticklabels={0,2.5,5},
        xlabel=Time (day),
        ylabel=Temperature,
        grid=major,
        xtick scale label code/.code={},
        ]
%       \addplot [red, thick,mark=*,mark repeat=100] file [x=num,y=AccTwo]
        \addplot [red] file [x=Num, y=H1]
            {load.csv};
%       \addplot [green, thick] file [x=Num, y=H2]
%           {load.csv};
        \legend{Hive 1}
%       \legend{Hive 1,Hive 2}
    \end{axis}
\end{tikzpicture}

\end{document}

我正在使用 lualatex 进行编译,但收到此错误:

! Dimension too large.
\pgfplotsaxisdeserializedatapointfrom@private@LUA ...
                                                  \pgfplotsaxisdeserializeda...
l.31    \end{axis}

我能做些什么?

答案1

我做了一些改动,让它可以运行。对你来说,重要的部分是 torestrict y domainrestrict x domainto。无关紧要的改动是我将其转换为空格分隔并更改了版本号。现在它可以很好地运行lualatex.

    \documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{/pgf/number format/use comma,compat=newest}


\begin{document}


\begin{tikzpicture}
    \begin{axis}[
        xmin = 0,
%       xmax = 25000,
        ymin = 0,
        ymax = 60,
        width=19cm,
%       xtick={0,2500,5000},
%       xticklabels={0,2.5,5},
        xlabel=Time (day),
        ylabel=Temperature,
        grid=major,
        xtick scale label code/.code={},
         restrict y to domain=0:60,
         restrict x to domain=0:40
        ]
%       \addplot [red, thick,mark=*,mark repeat=100] file [x=num,y=AccTwo]
        \addplot [red] table [x =Num, y=H1]
            {load.csv};
%       \addplot [green, thick] file [x=Num, y=H2]
%           {load.csv};
        \legend{Hive 1}
%       \legend{Hive 1,Hive 2}
    \end{axis}
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容