Dear ConTeXt/MetaFun folks,

looking at the example for grid and functions in the MetaFun manual [1]
section 9.3

        drawoptions(withpen pencircle scaled .25pt withcolor .5white) ;
        draw hlingrid(0, 20, .2, 20cm, 10cm) ;
        draw vloggrid(0, 10, .5, 10cm, 20cm) ;
        drawoptions(withpen pencircle scaled .50pt) ;
        draw hlingrid(0, 20, 1, 20cm, 10cm) ;
        draw vloggrid(0, 10, 1, 10cm, 20cm) ;
        
        fmt_pictures := false ; % use TeX as formatting engine
        textextoffset := ExHeight ; % a variable set by ConTeXt
        draw hlintext.lft(0, 20, 5, 20cm, "@3e") ;
        draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ;
        
        draw
        function(1,"log(x)","x",1,10,1) xyscaled (10cm,2cm)
        withpen pencircle scaled 5mm withcolor transparent(1,.5,yellow) ;

I am confused how the resulting function is scaled correctly. The
resulting dimensions seem to be 10cm and 18 cm. So I guess the 2 cm mean
to shift it up some how.

Could someone please explain to me how `xyscaled` works in this case
please. I though `xyscaled (αcm, ζcm)` would set the object/path to a
width of α cm and a height of ζ cm.


Thanks,

Paul


[1] http://www.pragma-ade.com/general/manuals/metafun-s.pdf

Attachment: test.pdf
Description: Adobe PDF document

\starttext
\startMPcode
drawoptions(withpen pencircle scaled .25pt withcolor .5white) ;
draw hlingrid(0, 20, .2, 20cm, 10cm) ;
draw vloggrid(0, 10, .5, 10cm, 20cm) ;
drawoptions(withpen pencircle scaled .50pt) ;
draw hlingrid(0, 20, 1, 20cm, 10cm) ;
draw vloggrid(0, 10, 1, 10cm, 20cm) ;

fmt_pictures := false ; % use TeX as formatting engine
textextoffset := ExHeight ; % a variable set by ConTeXt
draw hlintext.lft(0, 20, 5, 20cm, "@3e") ;
draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ;

draw
function(1,"log(x)","x",1,10,1) xyscaled (10cm,2cm)
withpen pencircle scaled 5mm withcolor transparent(1,.5,yellow) ;
draw fullsquare xyscaled (10cm,2cm);
\stopMPcode

\startMPcode
draw fullsquare xyscaled (1cm,1cm);
\stopMPcode
\startMPcode
draw fullsquare xyscaled (2cm,1cm);
\stopMPcode
\startMPcode
draw fullsquare xyscaled (1cm,2cm);
\stopMPcode
\startMPcode
draw fullsquare xyscaled (1,2);
\stopMPcode
\stoptext

Attachment: signature.asc
Description: This is a digitally signed message part

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to