[metapost] problems with memory in metapost

Yogeshwarsing Calleecharan yogeshwarsing.calleecharan at ltu.se
Sat May 8 14:45:13 CEST 2010


Thanks. But how to write such a "script". In what language? can this be 
done on the command line in Win XP?

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
>




More information about the metapost mailing list