add plotting function (matplotlib required)