H Fabrice, You did not provide a good minimum test because the graph by itself renders fine:
fabr.pdf
Description: Adobe PDF document
Best wishes, Taco (if all else fails, you can replace \startMPcode with \startMPpage and generate a standalone graph that way) > On 25 Apr 2024, at 12:27, Fabrice Couvreur <fabrice1.couvr...@gmail.com> > wrote: > > Hi, > I don't know if I can explain the problem I'm having. I made a project with > 14 chapters. In each of them, there are graphics embedding metapost code. I > proceed as follows : I compile each chapter alone with lmtx then I compile > the project containing the 14 chapters. I didn't encounter any problems > except with a graphic from the last chapter. It is indeed in chapter 14 but > not in the project ! I give the code for this graph. > Thanks. > Fabrice > > \startMPcode > > interim linejoin := mitered; > interim ahangle := 30; > numeric u, pi; > > pi = 3.141592653589793; > u = 1.5cm; > > vardef graph_of_function (suffix f) (expr xmin, xmax, xsep) = > for x = xmin step xsep until xmax: (x, f(x)) .. endfor > (xmax, f(xmax)) > enddef ; > > vardef vline (suffix f, g) (expr x) = (x, min(f(x), g(x))) -- > (x, max(f(x),g(x))) enddef; > > vardef area_between_functions (suffix f, g)(expr a, b, xsep) = > buildcycle(graph_of_function(f, a, b, xsep), vline(f, g, > b), > reverse graph_of_function(g, a, b, xsep), reverse vline(f, > g, a)) > enddef; > > vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0) enddef > ; > vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax) enddef > ; > > > xmin:=-pi/2; xmax := 3*pi/2; > ymin := -1.5; ymax := 5; > > > vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef; > vardef g(expr x)=-exp(-x)*cos(x) enddef; > path C_f, C_g; > C_f = graph_of_function(f,xmin, xmax, .1); > C_g = graph_of_function(g, xmin, xmax, .1); > > a := xpart(C_f intersectionpoint C_g); > b := xpart(reverse C_f intersectionpoint reverse C_g); > > fill (area_between_functions(f, g, a, b, 0.1)) scaled u > withcolor 0.4[white, blue]; > draw C_f scaled u withcolor blue; > draw C_g scaled u withcolor blue; > > > \stopMPcode > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > 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 > ___________________________________________________________________________________ — Taco Hoekwater E: t...@bittext.nl genderfluid (all pronouns)
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___________________________________________________________________________________