You just ploted the function x^2-4, nothing else. Do you understand how the Newton's method is working ? There is no iteration in your script