How to add newline to x label of a plot ?
324 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
KSSV
le 23 Jan 2017
plot(1:10)
xlabel({'hello';'there'})
3 commentaires
Ifigenia Aslanidou
le 23 Nov 2021
Hello, is there any other way to change line when editing the labels through property inspector? Appreciate any help!
Plus de réponses (2)
Jose Rego Terol
le 30 Jan 2020
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?
Naman Shantha KUMAR
le 27 Nov 2020
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
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!