ch07: add query result plotting code