3

How to fix dimension too large error?

\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}
Display Name
  • 46,933

2 Answers2

3

This doesn't have dimension too large errors (and is shorter and does not impose any restriction on the compiler).

\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}

enter image description here

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}

enter image description here

user187802
  • 16,850