Label the scales-plot

1 次查看(过去 30 天)
evi
evi 2015-4-2
Hello!!! I want to plot a graph of a given function in MATLAB..
Is it possible to label the scales in powers of 2?

回答(1 个)

the cyclist
the cyclist 2015-4-2
编辑:the cyclist 2015-4-2
figure
plot(2.^(5*rand(1,100)),rand(1,100),'.');
set(gca,'XTick',2.^[0:5])
If you want the labels to be the powers, rather than the numbers themselves, then add the line
set(gca,'XTickLabel',0:5)

类别

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