I have a plot with x axis takes the value 1, 2, 3,.... I want to add a text "day" to these values so that they will be "Day 1","Day 2", "Day 3",... I did not find a relevant post on the Internet.

 Réponse acceptée

Star Strider
Star Strider le 25 Mai 2020

0 votes

if you have R2016b or later, use the xtickformat function to do what you want.
Example —
x = 1:10
y = rand(1,10);
figure
plot(x, y)
xtickformat('Day %g')
producing:
.

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Styling dans Centre d'aide et File Exchange

Produits

Version

R2020a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by