Dear list,

I am a huge fan of the new metafun interface.
Hans asked for luametafun requests, so here are a few.

 - color by value in lmt_surface
We want to show a surface plot of a function where the color indicates the 
function value (instead, or in addition to a light source).
The easiest would be to have variable cf for the brightness factor (as it is), 
and in addition variables such as zt, minz, maxz, akin to the color formatter 
for lmt_contour.
This becomes handy when colors are to be aligned with function values (e.g. 
negative = blue, zero = white, positive = red, see MWE attached).

 - controlling line levels in lmt_contour
It would be convenient if certain levels could be set by the user. E.g. to make 
sure the zero level contour line is included.
The user interface could potentially take a list, levels = { -1, -.5, 0, .5, 1 
}, of contour level lines. See MWE attached.
From my understanding marching squares can do that. A possible reference 
implementation could be QuadContourGenerator [1] in matplotlib, a bit of 
description can be found in [2].

 - colormaps
Contour plots often use rather complex colormaps, such as jet, rainbow or 
veridis. They are optimized for perceptual resolution, color blindness, 
screen/print or certain use cases.
The functionality is already there, but from a user's perspective, it would be 
much easier if some of these were provided by the interface.
The interface could be color = "colormap('jet')(l/n)". Indeed, these are useful 
in other use cases as well, such as bar charts, surface plots or shades.
One rudimentary example is in the attached file.

 - number of levels in lmt_contour (potential bug)
The number of levels is different from the user's input. Depending on the 
output range it can be lower or higher (see MWE attached).

Cheers,
Jacob Kauffmann

[1] 
https://github.com/matplotlib/matplotlib/blob/96ff1146ad053c5c7481efd9de039c879a595968/src/_contour.cpp
[2] 
https://github.com/matplotlib/matplotlib/blob/96ff1146ad053c5c7481efd9de039c879a595968/src/_contour.h

Attachment: colors_and_contours_in_luametafun.tex
Description: Binary data

Attachment: colors_and_contours_in_luametafun.pdf
Description: Adobe PDF document

___________________________________________________________________________________
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