How to smoothen the curve for yaxis in logx axis?
3 views (last 30 days)
Show older comments
y=0.2:.1:1
y = [0.92,0.9,0.75,0.47,0.32];
x = [10e-02,10e-1, 10e0, 10e1, 10e2];
ylim ([0.2 1])
loglog(x,y,'LineSmoothing','on')
set(gca,'YLim',[0 1])
grid on
Accepted Answer
Star Strider
on 21 Nov 2018
Try interpolation:
y = [0.92,0.9,0.75,0.47,0.32];
x = [10e-02,10e-1, 10e0, 10e1, 10e2];
xi = logspace(log10(min(x)), log10(max(x)), 50);
yi = interp1(log(x), log(y), log(xi), 'pchip');
ylim ([0.2 1])
loglog(x, y)
hold on
loglog(xi,exp(yi))
hold off
set(gca,'YLim',[0 1])
grid on
2 Comments
More Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!