Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

task_timing.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. function task_timing(statetable, varargin)
  2. % draw.task_timing(statetable)
  3. %
  4. % names = { "Start Cue", "Nose in Fixation","Target Cue","Go Sound", "Nose in Target"}';
  5. % start_state = [ 0, 0.15, 0.3, 1.3, 1.65]';
  6. % stop_state = [ 0.15, 1.5, 1.65, 1.35, 1.8]';
  7. % color = cellfun(@(x)x/255, {[48, 110, 29], [0,0,0], [48, 122, 242], [241, 151, 55],[140,40,93]}, 'UniformOutput',0)';
  8. %
  9. % T = table(names, start_state, stop_state, color);
  10. %
  11. % draw.task_timing(T)
  12. %
  13. % % You can adjust the width after using Position
  14. % set(gca,'Position',[0.1 0.1 0.3 0.7])
  15. % saveas(gcf, 'mytask.pdf')
  16. if nargin==0
  17. names = {"Test State"};
  18. color = {'r'};
  19. start_state = 0;
  20. stop_state = 0.3;
  21. statetable = table(names, color, start_state, stop_state);
  22. end
  23. clf;
  24. ax = draw.jaxes;
  25. for x = 1:size(statetable,1)
  26. plot_state(ax,statetable(x,:), -0.2, max(statetable.stop_state)+0.2, 9.5-x)
  27. end
  28. plot(ax,[0 0.5],[9-x 9-x],'k','LineWidth',2);
  29. sh = text(0.25,8.5-x,'0.5 s');
  30. sh.HorizontalAlignment = 'center';
  31. ax.Visible = 'off';
  32. ax.YLim = [-1 10];
  33. end
  34. function [lh, th] = plot_state(ax, row, pre , post, ypos)
  35. startx = row.start_state;
  36. stopx = row.stop_state;
  37. color = row.color{1};
  38. sname = row.names{1};
  39. x = [pre, startx, startx, stopx, stopx, post];
  40. y = ypos + [0, 0, 0.6, 0.6, 0, 0];
  41. lh = plot(ax, x,y, 'Color',color,'LineWidth',2);
  42. th = text((pre)/2,ypos + 0.3, sname);
  43. set(th,'Color',color,'HorizontalAlignment','right','FontWeight','bold');
  44. end