[metapost] problems with memory in metapost

Daniel Luecking luecking at uark.edu
Mon May 10 22:39:04 CEST 2010

----- Original Message -----
From: Taco Hoekwater <taco at elvenkind.com>
Date: Saturday, May 8, 2010 1:43 am
Subject: Re: [metapost] problems with memory in metapost
To: Yogeshwarsing Calleecharan <yogeshwarsing.calleecharan at ltu.se>
Cc: metapost at tug.org

> > Now, I have a small question: The mp file was about 4 MB while 
> the 
> > generated eps file is about 23 MB! How to make this eps file 
> smaller? I 
> > can't submit such a big size eps to a journal via email.
> Adding mpprocset:=1 will help a little, but not that much.
> It looks you (or gnuplot) are creating small rectangles instead
> of simple dots, and that means that every data point expands into
> quite a bit of postscript code:
>   newpath 414.37424 124.80127 moveto
>   416.37424 122.80127 lineto
>   418.37424 124.80127 lineto
>   416.37424 126.80127 lineto
>   closepath stroke
> The best the metapost backend can do (with mpprocset) is to convert
> the operator names into single letters, but that will not gain you
> a whole lot of bytes.
> Perhaps you could draw lines instead of dots? (I don't know anything
> about GNUplot's metapost output).

I was involved in writing the metapost terminal code. The terminal  format
requires the a minimum number of shape be available for the plot type
"with points". The square is one of those. There is a triangle available,
which would save one line per point. The circular shape would be least

I would recommend the postscript terminal, as it has the shapes predefined.
The metapost terminal, if it has any advantage at all, is in the editability of
the output, and the availability of TeX code for labels. 

Alternatively, don't use "with points" in the gnuplot script, or edit down the data
files (or use the "every" capability of gnuplot).

Dan Luecking

More information about the metapost mailing list