%% Root Locus plot customised for printing
% When  rlocus command is used it is diffficult to get at the different
% plot comp[onents to customise the plot. The command rlocus plot is used
% here (see MATLAB help) to customise
%% Generate System and create initial plot
clear; close all
a = 1.743e-5;
m = 1;
b = 0.098;


%physical plant
SYS = tf([a],[m b 0]);     %TF of system in velocity
poles = pole(SYS);

h = rlocusplot(SYS);
p = getoptions(h);
p.grid='on';
p.XLimMode='manual';
p.YLimMode='manual';
p.xlim={[-0.12 0]};
p.ylim={[-1.5e-3 1.5e-3]};
p.title.FontSize=12;
p.title.String='';
setoptions(h,p)
 
%% Add in Legible Marker s and rootlocus plots for printing
hold on
plot(poles(1),0,'xk','markersize',15,'linewidth',3)
plot(poles(2),0,'xk','markersize',15,'linewidth',3)
plot([poles(2) poles(2)/2 poles(2)/2],[0 0 1],'k','linewidth',3)
plot([0 poles(2)/2 poles(2)/2],[0 0 -1],'k','linewidth',3)

set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])

xlabel('- \zeta \omega_{n}','fontsize',24)
y = ylabel('j\omega_{d}','fontsize',24);
grid on;

hold off