LABELLING PLOTS IN MATLAB

10 次查看(过去 30 天)
yiga benjamin
yiga benjamin 2020-11-13
回答: Ameer Hamza 2020-11-13
I want to label my x-axis plot as three months June, July and August. I am plotting datasets against months , how do i label the x-axis

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-11-13
If you have numeric values on x and y axis, you can set the xticklabels
x = linspace(1, 3);
y = rand(size(x));
plot(x, y);
xticks([1 2 3])
xticklabels({'June', 'July', 'August'})

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by