Hi,

I am experimenting the new LuaMetaTeX features introduced recently, but I can't 
get the built-in features together.

To explain the problem I encounter, I want to draw the graph of a function on a 
grid in which the x-axis and the y-axis are alos drawn.
Now lmtx has the « instances » (if I am not wrong…) named lmt_axis, lmt_grid 
and lmt_function which separately work fine, but I dont see how to use them 
simultaneously by keeping the correct scaling. 
In the minimal example below, copied from luametafun.pdf, the graph of the 
function $f(x) := (x - 1)^2$ should be drawn by showing its minimum at $x = 1$, 
and its value at $x = 0$ should be equal to 1. However the graph on the grid 
does not show this. Moreover the axes do not match the grid.

This means that I have not understood how to give the same units and scales in 
the three instances lmt_axis, lmt_grid and lmt_function.

Thanks for any help: Otared K.
PS: here is a minimal example
% begin grid-axis-function.tex
\starttext
\startplacefigure 
\startMPcode{doublefun} 
        draw lmt_grid [
        nx = 10, 
        ny = 10,
        dx = 1, 
        dy = 1 
        ] xsized 5cm withpen pencircle scaled .1pt withcolor "darkblue" ;
        
        draw lmt_axis [
        nx = 10,
        ny = 10,
        dx = 1, 
        dy = 1, 
        ] xsized 5cm withpen pencircle scaled .5pt withcolor "darkred" ;
        
        draw lmt_function [
        xmin =  0, xmax = 2, xstep = .05,
        ymin = 0, ymax =  1.5,
        code = "(x - 1)*(x - 1)", 
        ] xsized 5cm withpen pencircle scaled .75pt ;
\stopMPcode
\stopplacefigure
\stoptext
% end grid-axis-function.tex
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to