Source
-2.5 3 setyrange
-4.5 3.5 setxrange
35 setxunit
.5 .5 setquadrillagestep
10 setfontsize

gsave
   orange
   3 setlinewidth
   [-.5 0 1 0] ligne
grestore

%quadrillage
/unites {} def
tracerepere
marks
/ymarkstyle {cltext} def
-.5 ymark
/ymarkstyle {crtext} def
.5 ymark

/A {1 -1} def
/D {2.5 .8} def
/B {-4 -1} def
/C {3 2} def

gsave
   orange
   [-3 -1 2] {0 circ2} apply
grestore
gsave
1 dict begin
   /point {times2} def
   [-2 .5 1.5 -.5] dashpoints
   pointilles
   [1 -1 dupp projx] ligne
   [-.5 -1 dupp projx] ligne
   [3 2 dupp projx] ligne
   [-4 -1 dupp projx] ligne
end   
grestore
gsave
   mixte
   bleu
   {pop -1} courbe
   {pop 2} courbe
grestore

[B C] points
A dashpoint

1.2 setlinewidth
/arg {argc} def
[B .. -3 0 .. -2 .5 .. -1 0 .. -.5 -1 .. 0 -1.5  {right} .. 1 -1 .. 2 0 .. D .. C] draw

.6 setlinewidth
pointilles

setTimesItalic
   (O) O dltext
   (A) A drtext

<tex>
$y = 2$
</tex>
3 2 uctexlabel

<tex>
$y = -1$
</tex>
3 -1 dctexlabel

<tex>
$y = f (x)$
</tex>
D ultexlabel