How to create a timeline ?
6 次查看(过去 30 天)
显示 更早的评论
I want to have the time (e.g from january to december) on the x-axis and just location on the "y axis". Example:
LOCATION
location 1 x_________ x
location 2 x __ x
location 3 x x_xx__xxx__xxx
timline jan ---- juni ---- dec --- > 2016
0 个评论
采纳的回答
Star Strider
2017-1-20
See if something like this does what you want:
dnv = datenum([2016 01 00]) + cumsum(eomday(2016, 1:12)); % X-Axis Dates
loc1 = datenum([2016 01 01]) + randi(364, 1, 3); % Create Data
loc2 = datenum([2016 01 01]) + randi(364, 1, 5); % Create Data
loc3 = datenum([2016 01 01]) + randi(364, 1, 7); % Create Data
figure(1)
plot(loc1, 3*ones(size(loc1)), 'x')
hold on
plot(loc2, 2*ones(size(loc2)), 'x')
plot(loc3, 1*ones(size(loc3)), 'x')
hold off
grid
set(gca, 'XTick', dnv)
datetick('x', 'mmm', 'keepticks')
axis([xlim 0 4])
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Christmas / Winter 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
