Adding matplotlib plotting functionalities to replace pgplot.