绘制以下累积频率时如何修复“尺寸太大”错误?

绘制以下累积频率时如何修复“尺寸太大”错误?

如何修复dimension too large错误?

\documentclass[pstricks,dvipsnames]{standalone}
\usepackage{pst-plot,filecontents,siunitx}

\begin{filecontents*}{test.data}
0       0
3       20
5       35
10      85
15      155
16      170 
20      275
21      320
22      380
23      440
25      540
26      570
27      600
28      620
29      640
31      670
33      690
35      705
37      720
42      740
45      750
\end{filecontents*}

\newpsstyle{mygrid}
{
    Dy=100,
    Dx=10,
    Ox=0,
    tickwidth=1.2pt,
    subticksize=1,
    xsubticks=10,
    ysubticks=10,
    subtickcolor=gray,
    subtickwidth=.8pt,
    xAxisLabel=\huge Time (\si{\minute}),
    xAxisLabelPos={c,-30},
    yAxisLabel=\huge Cumulative Frequency,
    yAxisLabelPos={-5,c},
    llx=-2,
    lly=-2,
    urx=1,
    ury=1,  
}
\readdata{\mydata}{test.data}
\begin{document}
\begin{psgraph}[style=mygrid,xticksize=0 800,yticksize=0 50](0,0)(50,800){12.5cm}{20cm}
\listplot[plotstyle=cspline,linecolor=black,linewidth=2.4pt,showpoints]{\mydata}
\end{psgraph}
\end{document}

答案1

\documentclass[pstricks,dvipsnames]{standalone}
\usepackage{pst-plot,filecontents,siunitx}

\begin{filecontents*}{test.data}
    0       0
    3       20
    5       35
    10      85
    15      155
    16      170 
    20      275
    21      320
    22      380
    23      440
    25      540
    26      570
    27      600
    28      620
    29      640
    31      670
    33      690
    35      705
    37      720
    42      740
    45      800
\end{filecontents*}

\newpsstyle{mygrid}
{
    Dy=100,
    dy=10,
    Dx=10,
    Ox=0,
    tickwidth=1.2pt,
    subticksize=1,
    xsubticks=10,
    ysubticks=10,
    subtickcolor=gray,
    subtickwidth=.8pt,
    xAxisLabel=\huge Time (\si{\minute}),
    xAxisLabelPos={c,-30},
    yAxisLabel=\huge Cumulative Frequency,
    yAxisLabelPos={-5,c},
    llx=-2,
    lly=-2,
    urx=1,
    ury=1,  
}
\readdata{\mydata}{test.data}
\begin{document}
\pstScalePoints(1,1){}{10 div}
\begin{psgraph}[style=mygrid,xticksize=0 80,yticksize=0 50](0,0)(50,80){12.5cm}{20cm}
    \listplot[plotstyle=cspline,linecolor=black,linewidth=2.4pt,showpoints]{\mydata}
\end{psgraph}
\end{document}

在此处输入图片描述

答案2

这没有dimension too large错误(并且更短并且不会对编译器施加任何限制)。

\documentclass[tikz,border=3.14mm,dvipsnames]{standalone}
\usepackage{pgfplots,filecontents,siunitx}
\pgfplotsset{compat=1.16}
\begin{filecontents*}{test.data}
0       0
3       20
5       35
10      85
15      155
16      170 
20      275
21      320
22      380
23      440
25      540
26      570
27      600
28      620
29      640
31      670
33      690
35      705
37      720
42      740
45      800
\end{filecontents*}

\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=both,ytick={-100,0,...,900},minor y tick num=9,minor x tick num=9]
 \addplot table {test.data};
\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容