i Henri,
Thank you for your answer. The idea is to make the graph as an attachment. I converted to Metapost but the road is still long!
The code is from percusse on StackExchange. As you can see, there is a problem with the ellipse. How do I fix this ?
Thank you
Fabrice
\usemodule[tikz]
\starttext
\startMPcode
def match (expr pos) =
fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm) withcolor red;
draw fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
withshademethod "circular"
withshadevector (0,1)
withshadecolors (red,white)
enddef;
match((0,0));
\stopMPcode
\starttikzpicture
\define[2]\allumette{
\fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2);
\fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05);
\draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05);
\shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
\draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
}
\allumette{0.1}{0.2}
\filldraw[orange,scale=0.5,shift={(8.2,1.2)}] (0,0) .. controls (-1.5,1.25) and (.5,2) .. (-.2,4) .. controls (1,2.5) and (1,.5) .. (0,0);
\stoptikzpicture
\stoptext