Pour écrire un texte, en position (0,0) dans notre image, puis souligner ce texte...
from pyx import *
c = canvas.canvas()
c.text(0, 0, "Hello, world!")
c.stroke(path.line(0, 0, 2, 0))
c.writeEPSfile("hello")
c.writePDFfile("hello")
Ce qui donne, pour résultat, l'image ci-contre :
This page may have a more recent version on pmwiki.org: PmWiki:UnePageAuHasard, and a talk page: PmWiki:UnePageAuHasard-Talk.