How do you change the x scale of a plot to logs?

181 次查看(过去 30 天)
I am trying to make my plots x scale in logs i did it manually but don't know the code.

采纳的回答

Birdman
Birdman 2017-10-26
编辑:Birdman 2017-10-26

更多回答(1 个)

Jos (10584)
Jos (10584) 2017-10-26
That is easy :)
% draw a graph
x = 10.^[0:0.5:9] ;
y = 2 *log10(x) + 3 ;
plot(x,y,'bo-');
pause
% set the x-axis scale to log
set(gca,'Xscale','log') % yeah, that is indeed easy!

类别

Help CenterFile Exchange 中查找有关 Log Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by