How to add newline to x label of a plot ?

202 ビュー (過去 30 日間)
RuiQi
RuiQi 2017 年 1 月 23 日
コメント済み: Ifigenia Aslanidou 2021 年 11 月 23 日
How do I add a new-line to the x label of a plot ? Like i want it to be
Label A \newline
Label B

採用された回答

KSSV
KSSV 2017 年 1 月 23 日
plot(1:10)
xlabel({'hello';'there'})
  3 件のコメント
Jack Cooney
Jack Cooney 2019 年 2 月 28 日
title({'you are a';'bold one'})
Ifigenia Aslanidou
Ifigenia Aslanidou 2021 年 11 月 23 日
Hello, is there any other way to change line when editing the labels through property inspector? Appreciate any help!

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

その他の回答 (2 件)

Jose Rego Terol
Jose Rego Terol 2020 年 1 月 30 日
I tried this but I got an error.
xlabel({'Time (s)';'foot-Spike:' num2str(fs)})
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in spikes_detection_listdlg (line 36)
xlabel({'Time (s)';'foot-Spike:' num2str(fs)})
How can I include num2str within curly braces?
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 1 月 30 日
xlabel({'Time (s)'; ['foot-Spike:' num2str(fs)]})
Jose Rego Terol
Jose Rego Terol 2020 年 1 月 30 日
Works! Thanks!

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


Naman Shantha KUMAR
Naman Shantha KUMAR 2020 年 11 月 27 日
I wanted to implement the same in for loop, the below method worked for me;
xlabelname = {}
for ii = 1:10
...
xlabelname{ii,1} = strcat('plot',num2str(ii));
end
Hope it helps if someone is stuck in this part

カテゴリ

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

タグ


Translated by