How do you change the x scale of a plot to logs?
149 次查看(过去 30 天)
显示 更早的评论
I am trying to make my plots x scale in logs i did it manually but don't know the code.
0 个评论
采纳的回答
更多回答(1 个)
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Log Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!