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개)
Star Strider
2016년 12월 27일
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
2016년 12월 27일
0 개 추천
Answered previously (several times, this is one of better)... <points-on-graph-by-a-curve-not-straight-lines>
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!