TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have lots of data to be plotted(around 100000 points) in a single plot. But pgfplot is giving me error. What is the maximum limit(of points) for it to plot. But gnuplot is giving me the plot whereas pgfplot doesn't.

regards, sgp.

share|improve this question
have you tried increasing the memory available to tex? also an example would help. – Mica Nov 16 '10 at 2:09

100000 points is usually beyond the capabilities of pgfplots (unless with extreme memory settings, perhaps disabling markers).

An alternative approach which satisfies memory limits (and your patience while running latex) and still uses pgfplots for the axis descriptions is to employ its \addplot graphics method: there, you can generate the visualization (scatter plot?) with gnuplot, but you configure gnuplot to EXCLUDE any axis. Then, you include the generated graphics (as .eps or .png) into pgfplots, configuring only the data limits. PGFPlots will then include the graphics and will overlay its axis descriptions automatically (based on your supplied data limits). The pgfplots manual contains an example (even one which takes its image data from gnuplot output).

share|improve this answer
Thanks a lot for the reply. It was really helpful. – sgp Apr 24 '11 at 4:07

I think in this case I'd decimate the data before sending it to pgfplot. Consider that if your graph is, say, at most 10cm wide, having that many data points means they could be as close together as one micrometer, which you'll certainly never be bake to discern in the output.

share|improve this answer

With the default memory limits in TeXLive 2009 (3000000), I determined the limit to be 12175 points using only points (no lines). The number can vary depending on other plots in the same page and other factors, like point decorations. See the comments in How can one predict pgfplots memory overload?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.