Dear Mikael, Thank you for your solutions. They work fine.
Thanks again. Best wishes. Dalyoung > 2026. 1. 4. 오전 6:18, Mikael Sundqvist <[email protected]> 작성: > > Hi, > > On Sat, 3 Jan 2026 at 21:16, Jeong Dal via ntg-context > <[email protected] <mailto:[email protected]>> wrote: >> >> Dear Florent and Wolfgang, >> >> Thank you so much. >> >> Both of your method work well. >> >> I have another question. >> >> path p; >> P := z1—z2—z3—cycle; >> drawarrow p; >> >> It draw arrowhead at the last edge only. >> To draw arrowhead of each edge, I draw edges one by one. >> Is there a simple way to draw arrowhead of each edge? > > You can just loop through the path: > > \startMPpage[offset=1DK] > path p ; > numeric N ; N := 20 ; > > for i = 1 upto N : > z[i] = 1cm*dir(360*i/N) ; > endfor > > path p ; > p := for i = 1 upto N : z[i] -- endfor cycle ; > > drawarrow p withpen pencircle scaled 3 > withcolor darkblue ; > > for i = 1 upto N : > drawarrow (point i - 1 of p -- point i of p) > withpen pencircle scaled 1 > withcolor darkred ; > endfor > > for i within p : > drawarrow (deltapoint - 1 -- pathpoint) > withpen pencircle scaled .5 > withcolor darkyellow ; > endfor > \stopMPpage > > The second method is likely a bit faster if you have a long path. > > /Mikael > > >> >> Thanks again. >> >> Best regards, >> >> Dalyoung >> >> >> 2026. 1. 4. 오전 1:22, Wolfgang Schuster <[email protected]> >> 작성: >> >> Am 03.01.2026 um 16:32 schrieb Jeong Dal via ntg-context: >> >> Dear all, >> First, Happy New Year! >> I tried to draw a small figure using the following MetaFun code. >> The problem is the last line. >> If I run \processMPbuffer[sampleGraph] then it works well and draw the >> figure. >> But, if I add another buffer name like >> \processMPbuffer[sampleGraph, edgeLabel] >> Or >> \processMPbuffer[sampleGraph, multiGraph] >> Then an error occurred. In the log file, I found that >> metafun > log > error: Not implemented: (pair)*(color) >> metafun > log > >> metapost > trace > <error> (0.30901699437494745,0.95105651629515353) >> metapost > trace > <to be read again> ; >> metapost > trace > <for(1)> z [ (EXPR 0) ] = dir ( 360 * (EXPR 0) / >> (5) + (0) ) * ((0,0,0)) ; ENDFOR >> As you see here, 'mySize = (0,0,0)' not ‘2cm'. >> I don’t see what is the problem. >> Thank you for your reading. >> Best wishes, >> Dalyoung >> [...] >> \startbuffer[sampleGraph] >> setPoints(5,\MPvar{mySize},0); >> >> >> setPoints(5,\MPrawvar{sampleGraph}{mySize},0); >> >> Wolfgang >> >> ___________________________________________________________________________________ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : [email protected] / >> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) >> archive : https://github.com/contextgarden/context >> wiki : https://wiki.contextgarden.net >> ___________________________________________________________________________________ >> >> >> ___________________________________________________________________________________ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : [email protected] <mailto:[email protected]> / >> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >> <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl> >> webpage : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / >> https://context.aanhet.net <https://context.aanhet.net/> (mirror) >> archive : https://github.com/contextgarden/context >> <https://github.com/contextgarden/context> >> wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/> >> ___________________________________________________________________________________ > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : [email protected] <mailto:[email protected]> / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl> > webpage : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / > https://context.aanhet.net <https://context.aanhet.net/> (mirror) > archive : https://github.com/contextgarden/context > <https://github.com/contextgarden/context> > wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/> > ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
