[NTG-context] Position of MetaPost graphics

Aditya Mahajan adityam at umich.edu
Sun Apr 3 18:42:32 CEST 2011


On Fri, 1 Apr 2011, Tim Steenvoorden wrote:

(Untested).

> \startuniqueMPgraphic{wave}
> numeric periods, width;
> path wave;
> periods := 3 + 1/4;
> width   := periods * 2*pi;
> wave    := origin for x=0 step 0.1 until width:
>             -- (x,x*sin(x))
>           endfor;
> pickup pencircle scaled 1pt;
> draw wave xscaled (OverlayWidth/width) yscaled (OverlayHeight/(2*width));

   setbounds currentpicture to boundingbox OverlayBox ;

> \stopuniqueMPgraphic

Does setting the bounds of the current picture help?

Aditya


More information about the ntg-context mailing list