[NTG-context] Add labels to a grid (Metafun)

Fabrice Couvreur fabrice1.couvreur at gmail.com
Fri Mar 6 18:15:09 CET 2015

To add labels to a grid, Hans wrote a macro hlintext (Min, Max, Step, Lenght
, Format). I do not know what to put in "Format".
Best regards,

     input tex;
     numeric xmin, xmax, ymin, ymax;
     xmin := 0; xmax := 22; ymax :=460 ;ymin:=0; u := 0.5cm; v:= 0.025cm;
     drawoptions(withpen pencircle scaled 0.5pt withcolor
     draw hlingrid(ymin,ymax,20,11.5cm,11cm);
     draw vlingrid(xmin,xmax,2,11cm,11.5cm);
     drawoptions(withpen pencircle scaled 1pt) ;
     drawarrow (0,0)--(22,0) scaled u ;
     drawarrow (0,0)--(0,460) scaled v ;
     for i=0 step 2 until 20 :
     for i=0 step 20 until 440:
     label.bot( "$x$",(10.8cm,-0.1cm)) ;
     label.rt( "$y$",(0.1cm,11.3cm)) ;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20150306/6ff9078b/attachment.html>

More information about the ntg-context mailing list