Skip to content

Commit

Permalink
Modifying figure plots
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Nov 12, 2024
1 parent ba1142c commit b79a699
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
13 changes: 7 additions & 6 deletions projDir/qc/dataProcessing/research/specMethod/optimizeTP.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

close all
numZero=2:250;
xlim1=[1,249];
xlim1=[1,150];
xlim2=[400,800];

f1 = figure('Position',[200 500 600 1000],'DefaultAxesFontSize',12,'renderer','painters');
Expand All @@ -28,22 +28,23 @@
scatter(6,err21(5),'filled','MarkerFaceColor','red','MarkerEdgeColor','k');
xlabel('Truncation piont');
ylabel('RMSE (dB)');
ylim([5,11]);
ylim([5,8]);
xlim(xlim1);

grid on
box on
title('(a) Root mean square error of example spectrum')
annotation('textarrow',[0.27,0.13],[0.84,0.75],'String','Optimum truncation point','FontSize',12)
annotation('textarrow',[0.27,0.14],[0.84,0.785],'String','Optimum truncation value','FontSize',12)

s2=nexttile(2);

bar(numZero(1:end-1),H./sum(H).*100,1,'red')

xlabel('Truncation piont');
ylabel('Frequency (%)')
title('(b) Distribution of optimum truncation points')
annotation('textarrow',[0.27,0.135],[0.615,0.6],'String',' Most frequent optimum truncation point','FontSize',12)
title('(b) Distribution of optimum truncation values')
annotation('textarrow',[0.27,0.145],[0.615,0.6],'String',' Most frequent optimum truncation value','FontSize',12)
xlim(xlim1);

grid on
box on
Expand All @@ -63,7 +64,7 @@

grid on
box on
title('(c) Example with optimum truncation point of 40')
title('(c) Example with optimum truncation value of 40')
legend([l1,l2,l3,l4],{'Signal A';'Signal B';'Filtered TP=40';'Filtered TP=7'},'Location','northwest');

h1=drawellipse('Center',[530,-53],'SemiAxes',[15,9.5],'Color','b', ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@
hold on
l5=plot(xdata,dftps,'-b','LineWidth',2);
xlim(xlim2);
xlabel('Spectral bin number');
xlabel('Time (10^{-4}s)');
ylim([0,60]);
yticks(0:15:75);
annotation('textarrow',[0.65,0.56],[0.45,0.38],'String','Truncation point','FontSize',12)
annotation('textarrow',[0.65,0.56],[0.45,0.38],'String','Truncation value','FontSize',12)

plot([472,485],[17,0],'-k');
plot([492,505],[17,0],'-k');

grid on
box on
%title('(a) Example spectrum')
legend([l5,l4],{'DFT_{ps}';'DFT_{bbs}'},'Location','northwest');
text(555,55,'(b)','FontSize',12,'FontWeight','bold')


s3=nexttile(3);

hold on
Expand All @@ -88,5 +92,30 @@
legend([l1,l4,l3,l2],{'PS_{raw}';'PS_{cf}';'PS_{f}';'Sp. noise floor'},'Location','northwest');
text(920,-25,'(c)','FontSize',12,'FontWeight','bold')

% Inset
ai=axes('Position',[.2 .45 .16 .07]);
hold on
l5=plot(xdata,dftps,'-b','LineWidth',1.5);
ylim([0,1])
yyaxis right
l4=plot(xdata,dftbbs,'-r','LineWidth',1.5);
% s2.YAxisLocation = 'right';
% s2.XTick = [];
ai.YAxis(2).Color = [0 0 0];
xlim([485,505]);
box on
%ylim([0,1])
% yticks(0:0.025:0.1);
%
% s2x=axes(t,'Color','none');
% %s2x.Layout.Tile=2;
% hold on
% l5=plot(xdata,dftps,'-b','LineWidth',2);
% xlim(xlim2);
% xlabel('Time (10^{-4}s)');
% ylim([0,60]);
% yticks(0:15:75);
hold off

set(gcf,'PaperPositionMode','auto')
print(f1,[figdir,'specCorr.png'],'-dpng','-r0');

0 comments on commit b79a699

Please sign in to comment.