% plots the solutions computed by Bertini using the file 'finite_solutions'

% open 'finite_solutions'
RF = fopen('finite_solutions', 'r');

% make sure the file exists
if RF == -1
    % file does not exist
    disp(['The file ''finite_solutions'' does not exist!']);
    return;
end;

% read in the number of points
numPts = fscanf(RF, '%d', 1);

% setup Pts
Pts = fscanf(RF,'%e',2*numPts);
Pts = Pts(1:2:end) + 1i*Pts(2:2:end);

% close file
fclose(RF);

% plot integers 1..20 and Pts
plot(1:20,zeros(1,20),'ro','MarkerSize',10,'MarkerFaceColor','r'); 
hold on;
plot(real(Pts),imag(Pts),'bo','MarkerSize',10,'MarkerFaceColor','b');
hold off;
axis([0 22 -4 4]);
axis square;
set(gca,'FontSize',18);
xlabel('Real part of solution','FontSize',16);
ylabel('Imaginary part of solution','FontSize',16);
title('Solutions to original (red) and perturbed (blue) Wilkinson polynomial','FontSize',16);





