[metapost] problems with memory in metapost
Reinhard Kotucha
reinhard.kotucha at web.de
Sat May 8 22:20:33 CEST 2010
On 8 May 2010 Yogeshwarsing Calleecharan wrote:
> Thanks. But how to write such a "script". In what language?
I usually use Perl for things like this but any scripting language
supporting regular expressions is fine.
> can this be done on the command line in Win XP?
Not directly. Windows doesn't provide such tools. But even on Unix I
prefer a programming language like Perl.
If you are not familiar with scripting languages and regular
expressions, please put the file on a web server where I can download
it or, if impossible, send it to me by mail. But please note that
web.de rejects mails bigger than 5MB.
Regards,
Reinhard
> Thanks
>
> On 5/8/2010 2:32 PM, Reinhard Kotucha wrote:
> > On 8 May 2010 Taco Hoekwater wrote:
> >
> > > 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
> >
> > If all these rectangles have the same shape and size, one could
> > post-process the file and define a procedure:
> >
> > /R { newpath moveto
> > 2 -2 rlineto 2 2 rlineto -2 2 rlineto closepath stroke
> > } def
> >
> > Then the code-snippet above can be replaced by:
> >
> > 414.37424 124.80127 R
> >
> > This is actually equivalent to
> >
> > newpath 414.37424 124.80127 moveto
> > 2 -2 rlineto
> > 2 2 rlineto
> > -2 2 rlineto
> > closepath stroke
> >
> > Note the use of relative coordinates and rlineto.
> >
> > This should save a lot of space but requires some post-processing.
> >
> > Regards,
> > Reinhard
> >
>
>
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
More information about the metapost
mailing list