Porting to get remove matplotlib dependency completed.