# “TeX capacity exceeded, sorry” when drawing graph with PGFplots (whats the max that can be drawn)

Hey I have this graph I'm trying to draw but it uses about 15k (x,y) coordinates. When trying to create this document I'm getting this error that tex capacity is exceeded. Is there any way I can still draw it or I must reduce coordinate count?

\documentclass[landscape]{standalone}  %landscape
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{groupplots}
\pagenumbering{gobble}
\definecolor{my_col}{RGB}{56, 181, 64}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
extra y ticks = {0},
extra y tick labels = ,
extra y tick style  = { grid = major },
width=30cm,height=20cm,
xmin=0,    xmax=15909,
xtick={1,1591,3181,4771,6361,7951,9541,11131,12721,14311,15909},
ytick={-35.2,-31.2,-27.3,-23.3,-19.4,-15.4,-11.4,-7.5,-3.5,0.4,4.4,8.4,12.3,16.3,20.2,24.2,28.2,32.1,36.1,40,44},
yticklabel pos=right
]
line width=2pt,
my_col,
mark=none,
sharp plot
] table {table.dat};
\end{axis}
\pgfresetboundingbox
\path
(current axis.south west) -- ++(-0.4in,-0.4in)
rectangle (current axis.north east) -- ++(0.4in,0.4in);
\end{tikzpicture}
\end{document}

• Do you really need to show all coordinates of your graph? I doubt, that screen or printer have sufficient resolution, that theay will not be overlapped in the image. Also, we can test your mwe, since you not provide a table.dat. See, id you get satisfactory result, if you draw each tenth coordinate. – Zarko Oct 10 '20 at 18:18
• yea man thats what i ended up doing, I even drawed every 100th coordinate and it looked fine. Dont know if I should delete this question or not @Zarko – etrusks Oct 10 '20 at 18:28
• Well, if someone know, how many coordinate can pgfplots draw, this question will be very usable. So, I will left it (at liest for while), maybe a bit rephrase it (maybi "How many coordinates can be drawn by pgfplots?). Anyway, why xtick aren't in an order (, usually they are set from the smallest to to biggest) – Zarko Oct 10 '20 at 19:17
• they are in order xtick={1,1591,3181,4771,6361,7951,9541,11131,12721,14311,15909}, i just dont need 15k xtick labels so i picked just some :) @Zarko – etrusks Oct 10 '20 at 19:49