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.

Antworten (2)

Star Strider
Star Strider am 27 Dez. 2016

1 Stimme

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
dpb am 27 Dez. 2016

0 Stimmen

Answered previously (several times, this is one of better)... <points-on-graph-by-a-curve-not-straight-lines>

Gefragt:

am 27 Dez. 2016

Beantwortet:

am 27 Dez. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by