change scaling of x-axis
29 次查看(过去 30 天)
显示 更早的评论
I have data in IDCount(1,:) that goes from 0 to, say, 260. I want to rescale so the x-axis will appear in seconds -- IDCount(1,:)/140. Cannot see how to do this
0 个评论
采纳的回答
Star Strider
2017-9-15
Try this:
x = 0:260; % Create Data
y = rand(size(x)); % Create Data
figure(1)
plot(x, y)
xt = get(gca, 'XTick'); % 'XTick' Values
set(gca, 'XTick', xt, 'XTickLabel', xt/140) % Relabel 'XTick' With 'XTickLabel' Values
The set call relabels the 'XTick' values with the same values divided by 140.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!