Create matlab plot like the curve plot excel
Show older comments
Is it posible to create a matlab plot like the curve plot in excel ? I want to create a plot between a few points, but the plot makes straight lines between the points, and I want the plot to be with curved lines between the data points as shown in the example. The data labels are not importen.

Answers (2)
Star Strider
on 27 Dec 2016
This is probably as close as MATLAB can approximate that plot:
The Code:
x = [0 10.3 344 0.0];
y = [0 1.8 10 11.8];
yi = linspace(min(y), max(y));
xi = interp1(y, x, yi, 'pchip');
figure(1)
plot(xi, yi)
grid
set(gca, 'YDir','reverse')
txtstr = sprintf('%.1f, %.1f\n', [x' y']');
txtlbl = regexp(txtstr, '\n', 'split');
text(x, y, txtlbl(1:end-1), 'FontSize',8)
The Plot:

dpb
on 27 Dec 2016
0 votes
Answered previously (several times, this is one of better)... <points-on-graph-by-a-curve-not-straight-lines>
Categories
Find more on Annotations 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!