fixed sample code for custom plot function, ref #51