xlab = '$\ln|z_{n}-z_{n-1}|$'; 		% X-label
ylab = '$\ln|z_{n+1}-z_{n}|$'; 			% Y-label
mytitle = ''; 	% Title
z = newtoneger(1,1e-7,20);
%z = secanteger(1,2,1e-9,20);
N = length(z);
xx = log(abs(z(2:N-1)-z(1:N-2)));
yy = log(abs(z(3:N)-z(2:N-1)));
p = polyfit(xx,yy,1)
x1 = min(xx); x2 = max(xx);
y1 = p(1)*x1 + p(2);
y2 = p(1)*x2 + p(2);
plot(xx,yy,'bo','MarkerSize',7);
hold on
plot([x1,x2],[y1,y2],'r-','LineWidth',1.5);
grid

fontlabs = 'Times New Roman';   % Font type used in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  % x-Label size and font
ylabel(ylab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  % y-Label size and font
title(mytitle,'FontSize',16,'FontName','Times New Roman','interpreter','latex'); % Title size/font
set(gca,'FontSize',12);         % Axis tick font size

print -depsc newton_lnplot.eps
%print -depsc secant_lnplot.eps
