plot  cost function

Plot curve of the cost function J, first save these points of the cost
function into J_save, then plot these point with matplotlib