フィルターのクリア

change scaling of x-axis

33 ビュー (過去 30 日間)
Don
Don 2017 年 9 月 15 日
コメント済み: Star Strider 2017 年 9 月 15 日
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

採用された回答

Star Strider
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.
  2 件のコメント
Don
Don 2017 年 9 月 15 日
Thank you! That fixed it
Star Strider
Star Strider 2017 年 9 月 15 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by