Graphics, Figures & TablesTikz (\filldraw) error: tex capacity exeed...

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by kostao »

I try to draw map whith many countries, for example:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{plotmarks}
\usepackage{verbatim}
\usepackage{xcolor}
\usetikzlibrary{datavisualization}
\usepackage[active,tightpage, floats]{preview}
\usepackage{mathspec}
\usepackage{fontspec}
\newcommand*{\myfont}{OfficinaSerifC}%{Times New Roman} {Constantia}
\setmainfont{\myfont}[Ligatures=TeX]
\setsansfont{\myfont}[Scale=0.975]
\setmonofont{\myfont}
\setmathfont(Digits){\myfont}
\setlength\PreviewBorder{50pt}%
\begin{document}
\colorlet{colorForBorder}{gray!10}
\newcommand{\LineWidth}{thick}
\pagecolor{colorForBorder}
\begin{tikzpicture}[scale=1]
\filldraw [fill=red!50, draw=colorForBorder, very thin] plot[] file {USA_8434.txt};
\filldraw [fill=red!50, draw=colorForBorder, very thin] plot[] file {USA_4286.txt};
\end{tikzpicture}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Error: TeX capacity exceeded, sorry [main memory size=5000000]. ...r, \LineWidth] plot[] file {USA_8434.txt};

Data files http://dropmefiles.com/qlqZ3
Compiler is XeLaTex (for use fonts).
How fix it?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by Stefan Kottwitz »

Hi kostao,

with XeLaTeX it may be needed to split the plot because of the high amount of memory required for that plot.

However, with LuaLaTeX it runs fine without error. LuaTeX should be able to work with those fonts too. I got with your plot and LuaLaTeX:
usa.png
usa.png (6.04 KiB) Viewed 4492 times
Stefan
LaTeX.org admin
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by kostao »

How use this code in Luatex whitout errors?

Code: Select all

Code, edit and compile here:
\usepackage{mathspec}
\usepackage{fontspec}
\newcommand*{\myfont}{OfficinaSerifC}%{Times New Roman} {Constantia}
\setmainfont{\myfont}[Ligatures=TeX]
\setsansfont{\myfont}[Scale=0.975]
\setmonofont{\myfont}
\setmathfont(Digits){\myfont}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by Stefan Kottwitz »

Don't use mathspec. You could use the mathastext package. And unicode-math could be useful.

Stefan
LaTeX.org admin
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by kostao »

How split the plot? Please write an example.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Tikz (\filldraw) error: tex capacity exeed...

Post by Stefan Kottwitz »

You could split your plot txt data files into several small pieces. Then you could use a \filldraw command for each. So you distribute the effort over many separate \filldraw commands, so each one uses less memory.

Stefan
LaTeX.org admin
Post Reply