% generates Figure 3.3
% IMPORTANT: push buttom "Set axes equal shape" in the Axes Properties Editor
% ---------------------------------------------------------------------------

clear all; close all;
n2=9; v1=[-2:2]*pi*i; v2 = [-n2:n2]'*pi*i; point=5;
n1 = 500;
list = (0.5 + (-n1:n1))*i; l=length(list);
ax=[-4.01, 4, -6, 6]; 
clf; 
a=asinh(2*list); m = v2*(1+0*a) + (1+0*v2)*a; list=m(:);
figure(1)
hold on;
plot([0 0],ax(3:4),'k-');
plot(ax(1:2),[0 0],'k-'); 
axis(ax); hold on; 
set(gca,'FontSize',12,'FontWeight','normal','FontName','Times',...
    'XTick',[-4:2:4],'YTick',...
    [0]*pi/2,'YTickLabel',[0],'Box','on');
plot(list(:),'k.','MarkerSize',point);
figure(2)
hold on;
for j=0:8
    t=(5:0.1:100)+pi*(1/2+j)*i;
    a = asinh(t);
    for k=-2:2
        plot(a+k*pi*i,'k-','LineWidth',2);
        plot(-a+k*pi*i,'k-','LineWidth',2);
        plot(-conj(a)+k*pi*i,'k-','LineWidth',2);
        plot(conj(a)+k*pi*i,'k-','LineWidth',2);
    end
end
set(gca,'FontSize',12,'FontWeight','normal','FontName','Times',...
    'XTick',[-4:2:4],'YTick',...
    [0]*pi/2,'YTickLabel',[0],'Box','on');
plot(list(:),'k.','MarkerSize',point);
a=asinh(list); m = (1+0*a)*v1 + a*(1+0*v1); list=m(:);
plot([0 0],ax(3:4),'k-')
plot(ax(1:2),[0 0],'k-'); axis(ax); hold on; plot(list(:),'k.','MarkerSize',point);
hold on;

figure(1)
text(-4.1,-3*pi/2,'-3\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,-pi/2,'-\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,3*pi/2,'3\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,pi/2,'\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
xlabel('Re({\tau})','FontWeight','normal','FontSize',16);
ylabel('Im({\tau})','FontWeight','normal','FontSize',16);
figure(2)
text(-4.1,-3*pi/2,'-3\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,-pi/2,'-\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,3*pi/2,'3\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
text(-4.1,pi/2,'\pi/2','FontWeight','normal','FontSize',12,...
         'HorizontalAlignment','right','FontName','Times')
xlabel('Re({\tau})','FontWeight','normal','FontSize',16);
ylabel('Im({\tau})','FontWeight','normal','FontSize',16);

disp('IMPORTANT: push buttom "Set axes equal shape" in the Axes Properties Editor');