On Tue, 9 Oct 2018, Alan Braslau wrote:

On Mon, 8 Oct 2018 17:56:24 -0400 (EDT)
Aditya Mahajan <adit...@umich.edu> wrote:

Here is a proof of concept implementation in Lua + MP so that you can use:

\ContourPlot
   [
     function=2*x^5 + x*y + y^5,
     x={0, 2},
     y={-2, 0.5},
     n=1000, % Number of discretization points
   ]

The code is fairly fast. But be careful. As with all ConTeXt key-value
assignment, `x = { ...}` is different from `x={...}`. I am being a bit
lazy here, and haven't adapted the metapost code to draw the axes to adapt
to the function.

Hans and I played with Aditya's demonstration, to complete the example.
It demonstrates some fun lua+MP+ConTeXt tricks:

Looking at lua-mplib.mpvi, isn't it better to use MP namespace (instead of mp) for user defined functions?

The metafun manual says that one can omit the prefix `lua` and simply use `mp` or `MP`. That does not seem to work.

Aditya
___________________________________________________________________________________
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