J'ai un petit soucis de hachures : les codes que j'avais il y a un an ne produisent aucune erreur, mais les hachures n'y apparaissent plus.
Doutant de ma syntaxe, je prends une figure de référence que je compile moi-même : http://www.marris.org/asymptote/Courbes ... re_courbes
Et là c'est le drame : même pour cette figure de référence aucune hachure ne décide de se montrer.
Petit test sur mathematex :
Code : Tout sélectionner
import graph_pi;
import patterns;
usepackage("mathrsfs");
size(8cm,0);
graphicrules(xunit=1cm, yunit=1cm,
xmin=-1, xmax=4,
ymin=-3, ymax=3,
crop=Crop
);
// Définition et tracé de la grille
grid(xStep=1, xstep=.5,
yStep=1, ystep=.5,
pTick=.7bp+.7white,
ptick=.7bp+dotted+.7white,
above=false
);
// Définition et tracé des axes
cartesianaxis(
xticks=Ticks(Label(Fill(white)),
Step=1, step=.5,
NoZero,
ptick=grey),
yticks=Ticks(Label(Fill(white)),
Step=2, step=1,
NoZero,
ptick=grey),
Arrow
);
// Définition des fonctions
real f(real x) {return 2x-x^2;}
real g(real x) {return x;}
// Les hachures.
path zonehachuree=buildcycle(graph(f,0,3),(3,-5)--(3,5),graph(g,3,0));
add("hachure",hatch(H=1mm,dir=SE,lightgray));
fill(zonehachuree,pattern("hachure"));
// Tracé de courbe
path Cf=graph(f,-1.5,4.5,n=400);
path Cg=graph(g,-1.5,4.5,n=400);
draw(Cf,1bp+blue);
draw(Cg,dashed+1bp+red);
xlimits(-1.5,4.5,Crop);
ylimits(-3.5,3.5,Crop);
label("$\mathscr{C}_f$",(2.5,f(2.5)),SW,blue);
label("$\mathscr{C}_g$",(2.5,g(2.5)),NW,red);
labeloij(p=1.4bp+.5*red,
arrow=Arrow(SimpleHead,8bp),
dot
);