how to plot both axis (X and Y axis) as log scale using code ?
显示 更早的评论
I have use loglog(X, Y) but I getting an error.
回答(1 个)
Constantino Carlos Reyes-Aldasoro
2018-7-19
There are two easy ways to do this. First you can pass the values, but instead of directly the values pass their log, i.e.
plot(log(x), log(y))
The other way is through the handles
hPlot = plot(x,y);
and then modify the properties of the axes:
hPlot.xscale = 'log';
hPlot.yscale = 'log';
you can always change back to 'linear' if needed.
2 个评论
Rik
2018-7-19
The loglog function will do that second automatically.
Vishnu Dhakad
2018-7-19
编辑:Vishnu Dhakad
2018-7-19
类别
在 帮助中心 和 File Exchange 中查找有关 Log Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!