Fig1F.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. %% Fig. 1F - N of session to reach learning criterion
  2. %% Code for Fig. 1F
  3. clear
  4. close all
  5. % ==========================================================================
  6. %% Boxplot of initial and reversal learning
  7. % ==========================================================================
  8. %Load source data at first or use the following variables
  9. InitialLearning = [6 15 11 7 5 14 7 15];
  10. ReversalLearning = [5 10 17 9 7 9 11 7];
  11. %Initial Learning boxplot--------------------------------------------------
  12. sz = 20;
  13. fig1 = figure('Name', 'NofSession2Learn_Initial');
  14. fig1.Position = [1430 480 230 420];
  15. boxplot(InitialLearning, 'MedianStyle', 'line', 'Labels',{'Initial'})
  16. hold on
  17. h1 = scatter(ones(size(InitialLearning)).*(1+(rand(size(InitialLearning)))/10-0.03), InitialLearning, 'b', 'filled', 'MarkerFaceAlpha', 0.5);
  18. h1.SizeData = 40;
  19. %Lim and ticks
  20. ylim([0 18]);
  21. yticks([0 5 10 15 20]);
  22. %Label and title
  23. ylabel('N of Sessions')
  24. title('INI - N of Session to criterion')
  25. box off
  26. %Copy object
  27. ax_Ini = gca;
  28. %Reversal Learning boxplot-------------------------------------------------
  29. sz = 20;
  30. fig2 = figure('Name', 'NofSession2Learn_Reversal');
  31. fig2.Position = [1430 480 230 420];
  32. boxplot(ReversalLearning, 'MedianStyle', 'line', 'Labels',{'Reversal'})
  33. hold on
  34. h2 = scatter(ones(size(ReversalLearning)).*(1+(rand(size(ReversalLearning)))/10-0.03), ReversalLearning, 'r', 'filled', 'MarkerFaceAlpha', 0.5);
  35. h2.SizeData = 40;
  36. %Lim and ticks
  37. ylim([0 18]);
  38. yticks([0 5 10 15 20]);
  39. %Label and title
  40. ylabel('N of Sessions')
  41. title('REV - N of Session to criterion')
  42. box off