Graphics, Figures & Tables ⇒ Trouble with figure - TeX capacity exceeded
Trouble with figure - TeX capacity exceeded
I wanted to attach a minimal (should-be) working-example, but it told me it was not allowed to be above 256 KiB (the file is 935 KiB, and if I package it the best I can, it is still 260 KiB), so you can get the file here instead: http://bozack.dk/div/trialexportfigure2.tex
When I try to compile it (with MikTeX), I simply get the error TeX capacity exceeded, sorry [main memory size=1500000].
It's no wonder that the error happens, but what do I do to actually make the figure without it stalling with this error? Or is there simply not a way to get it to include so many points?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Trouble with figure - TeX capacity exceeded
http://www.latex-community.org/forum/vi ... =45&t=8195
Re: Trouble with figure - TeX capacity exceeded

So I'm not really able to use the advice with using a CVS file for the data-points and such, that were given in the linked thread..
Doesn't anyone else have any ideas?

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trouble with figure - TeX capacity exceeded
No matter which package is in use, the principal stays the same. It is much faster, less memory consuming and a little bit more comfortable to plot a CSV (Comma Separated Value) file. And Matlab should offer to export the data as such a CSV file. But perhaps you already have the data present in an external file. If so, you can upload it here as attachment(!) to your next post.Bozack wrote:The only trouble is that the forum thread you linked to was about Tikz, which I know nothing about. It googled it a bit, and as far as I understand, it is a "language" like PSTricks, to make graphics inside LaTeX documents? The examples I found were not immediately obvious for me to understand, and I would really really like to keep using PSTricks for this, instead of having to learn yet another language. [...]
If you can't manage that on your own, ask somebody from your personal surroundings who is familiar with that. Otherwise I'm pessimistic about specific help. And it's very unlikely that someone extracts the data from the file you linked. As soon as the data file is present, the final result is only some steps away.Bozack wrote:[...] So I'm not really able to use the advice with using a CVS file for the data-points and such, that were given in the linked thread. [...]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Trouble with figure - TeX capacity exceeded
The data defined in \mydata in the tex file I linked to earlier are all contained in the cvs file in the attached zip file below.
I guess all I need is a command to replace the
Code: Select all
\dataplot[plotstyle=line,showpoints=true,dotstyle=*,dotsize=\MarkerSize,linestyle=none,linewidth=\LineWidth,linecolor=color617.0006]{\mydata}

- Attachments
-
- export.zip
- (135.31 KiB) Downloaded 252 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trouble with figure - TeX capacity exceeded
Of course you can. That's what the pst-plot package is made for.Bozack wrote:I wasn't aware that it was possible to plot CVS values from a file with PSTricks - I've tried searching for it, but couldn't find anything. [...]
No, the attached file contains other data. The range of y-values differs from the data you introduced first. I deleted the whole data and the actual plot from your first example and got a grid with x in (0,600) and y in (-5,30). But apart from that I took the data file you attached to your last post and built an example for a nice plot as shown below.Bozack wrote:[...] The data defined in \mydata in the tex file I linked to earlier are all contained in the cvs file in the attached zip file below. [...]
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage{pst-plot,pstricks-add}
\begin{document}
\begin{figure}[!ht]
\centering
\scriptsize
\psset{llx=-1cm,lly=-1cm,urx=0mm,ury=0mm}
\psset{xAxisLabel={x axis},xAxisLabelPos={300,-0.5}}
\psset{yAxisLabel={y axis},yAxisLabelPos={-45,2}}
\psset{plotstyle=line}
\readdata[nStep=10]{\data}{export.txt}
% \psframebox[linestyle=dashed,linewidth=0.4pt]{%
\begin{psgraph}[Dx=100,Dy=1,subticks=5,ticksize=0pt 4pt](0,0)(600,4){9.9cm}{7cm}
\psaxes[Dx=100,Dy=1,subticks=5,labels=none,ticksize=-4pt 0](600,4)(0,0)(600,4)
\listplot[linecolor=blue]{\data}
\end{psgraph}
% }
\caption{A Matlab data plot with \textsf{PSTricks}}\label{fig:matlab-pstricks}
\end{figure}
\end{document}
- Attachments
-
- matlab-pstricks-plot.pdf
- A Matlab data plot with PSTricks
- (13.82 KiB) Downloaded 281 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Trouble with figure - TeX capacity exceeded

Sorry about the cvs file not containing the same data - I have several versions of the data I want plotted, and I wasn't sure which graph I actually gave in the beginning (and since I couldn't get it plotted, I didn't really think I had a way to figure it out). The principle was the same, and I also wanted these data plotted in the same way anyway.. I guess the data in the old file was actually the data times 20, and with some of the data points removed.
Thank you for showing me how to use pst-plot to read data - I actually read through a big part of the manual, but didn't understand the readdata command well enough


But, the whole point in making this thread was to be able to plot all my data points without getting an overflow. This was also easily done via the "matlab to PSTricks" script I used ealier (binning 10 points together at a time, and using their average instead - and simply plotting these points rather than the data). The code you gave me only read every ten points in the file, and plots these (as you also said), so that really wasn't the point

Is there really no way to be able to plot all the points in the file without getting an overflow of some kind? Something like only reading in parts of the file at a time or the like?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trouble with figure - TeX capacity exceeded
After all, there is. I did the compilation on my more powerful notebook. At first, I slightly changed the code as shown below.Bozack wrote:[...] Is there really no way to be able to plot all the points in the file without getting an overflow of some kind? Something like only reading in parts of the file at a time or the like?
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage{pst-plot,pstricks-add}
\begin{document}
\begin{figure}[!ht]
\centering
\scriptsize
\psset{llx=-1cm,lly=-1cm,urx=0mm,ury=0mm}
\psset{xAxisLabel={x axis},xAxisLabelPos={300,-0.5}}
\psset{yAxisLabel={y axis},yAxisLabelPos={-45,2}}
\psset{plotstyle=line}
% \psframebox[linestyle=dashed,linewidth=0.4pt]{%
\begin{psgraph}[Dx=100,Dy=1,subticks=5,ticksize=0pt 4pt](0,0)(600,4){9.9cm}{7cm}
\psaxes[Dx=100,Dy=1,subticks=5,labels=none,ticksize=-4pt 0](600,4)(0,0)(600,4)
\fileplot[linecolor=blue]{export.txt}
\end{psgraph}
% }
\caption{A Matlab data plot with \textsf{PSTricks}}\label{fig:matlab-pstricks}
\end{figure}
\end{document}
- Attachments
-
- matlab-pstricks-plot.pdf
- The same plot but now with the full data.
- (173.6 KiB) Downloaded 389 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Trouble with figure - TeX capacity exceeded
