abr_data_plot.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. %% This script loads the file "abr_analysis_results.mat" from the same folder and plots the data
  2. % load the data
  3. %load('abr_deafening_results.mat')
  4. % generate plot titles
  5. titles={'< 2 weeks of age';'< 3 weeks of age';'6 months of age';'3 years of age'};
  6. % plot bootstrap results and threshold
  7. figure,
  8. % for 24 subplots (i.e. 4 measurements per individual)
  9. for k=1:24
  10. subplot(6,4,k),
  11. % plot all measurements that have a bootstrap results above 0.95
  12. % confidence in green
  13. ph=plot(allCONFI(k).frequencies(find(allCONFI(k).confidences>0.95)),allCONFI(k).levels(find(allCONFI(k).confidences>0.95)),'ko');
  14. set(ph,'markerfacecolor','g')
  15. hold on,
  16. % plot all measurements that have a bootstrap results below 0.95
  17. % confidence as empty
  18. ph=plot(allCONFI(k).frequencies(find(allCONFI(k).confidences<=0.95)),allCONFI(k).levels(find(allCONFI(k).confidences<=0.95)),'ko');
  19. % set plot limits
  20. set(gca,'xlim',[5 90],'ylim',[40 120],'ytick',[40:40:120],'xscale','log','xtick',[5 10 20 40 90]);
  21. hold on,
  22. % plot the audiogram threshold line
  23. plot(resultTHRES(k).uniqueFrequencies,resultTHRES(k).bootstrapThresholds,'-k','linewidth',2);
  24. % set x- and y-axis labels
  25. set(gca,'xtick',[5 10 20 50 90])
  26. set(gca,'ytick',[40 80 120])
  27. % add titles and axis labels to plot
  28. if k == 1
  29. title(char(titles(k)),'FontSize',13);
  30. ylabel({['Deafened 1'] ; 'Level (dB SPL)' },'FontSize',11);
  31. elseif k==2 ||k==3|| k==4
  32. title(char(titles(k)),'FontSize',13);
  33. elseif k == 5
  34. ylabel({['Deafened 2'] ; 'Level (dB SPL)' },'FontSize',11);
  35. elseif k==9
  36. ylabel({['Deafened 3'] ; 'Level (dB SPL)' },'FontSize',11);
  37. elseif k==13
  38. ylabel({['Hearing 1'] ; 'Level (dB SPL)' },'FontSize',11);
  39. elseif k==17
  40. ylabel({['Hearing 2'] ; 'Level (dB SPL)' },'FontSize',11);
  41. elseif k == 21
  42. ylabel({['Hearing 3'] ; 'Level (dB SPL)' },'FontSize',11);
  43. xlabel('Frequency (kHz)','FontSize',11)
  44. elseif k == 22||k == 23||k == 24
  45. xlabel('Frequency (kHz)','FontSize',11)
  46. end
  47. end