-
Notifications
You must be signed in to change notification settings - Fork 1
/
barhTU.m
28 lines (24 loc) · 689 Bytes
/
barhTU.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function barhTU(y, TU, group_names)
% plot activity duration using stacked bar
% plot the time use bars
barh(y(:), TU, 'stack')
colormap summer
% set axis properties
pbaspect([2 1 1])
xlim([0 24])
x = 0:2:24;
set(gca,'XTick', x)
ylim([min(y(:))-.1*max(y(:)) 1.1*max(y(:))])
ylabel('Interactions coefficient \rho');
xlabel('Average activity duration (hours)')
legend(group_names, 'Location', 'SouthWest');
% set another x-axis at the top
ax1 = gca;
ax2 = axes('Position',get(ax1,'Position'),...
'YTickLabelMode','manual', ...
'XAxisLocation','top',...
'XTick', x, ...
'XLim',[0 24], ...
'Color','none');
pbaspect(ax2, [2 1 1])
end