Create matlab plot like the curve plot excel

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.

回答(2 个)

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:

类别

帮助中心File Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by