// guide[] graph(picture pic=currentpicture, // real[] x, real[] y, // bool3[] cond, // interpolate join=operator --); // // Returns a graph using the scaling information for picture pic of the // elements of the arrays (x,y), optionally restricted to those indices // for which the elements of the boolean array cond are true, using the // given interpolation type. import graph; size(7.5cm,0); real[] x={ -3 , -2 , 0 , 2 , 3 }, y={ 4 , 3 , -2 , 4 , 3 }; real a=2.5; // TROIS SYNTAXES POSSIBLES POUR ECRIRE LA CONDITION : // SYNTAXE 1 guide[] courbe=graph(x,y,y>a,join=operator ..); // SYNTAXE 2 // bool3[] condition=y>a; // guide[] courbe=graph(x,y,condition,join=operator ..); // SYNTAXE 3 // bool3[] condition(real[] x, real[] y){ // bool3[] cond=y>a; // return cond; // } // guide[] courbe=graph(x,y,condition(x,y),join=operator ..); dot(pairs(x,y),5bp+green); dot(courbe,3bp+blue); draw(courbe,red); draw((-3,a)--(3,a),dashed); xaxis("$x$",Ticks("%",end=false),Arrow()); yaxis("$y$",Ticks("%",end=false),Arrow()); // Thanks to gk-v and jcbowman for their help.