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

\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}
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
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
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 4265 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

\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}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
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: 10290
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