plotting code functional

(we hope :p )