フィルターのクリア

Plot smoothing line without points

11 ビュー (過去 30 日間)
Max1234
Max1234 2023 年 1 月 2 日
コメント済み: Star Strider 2023 年 1 月 3 日
Hey,
can i just plot the smoothing line without the scatter points? And is it possible to get just the Data of the smoothing line to plot more than one line in one figure?
Thank you!
  1 件のコメント
Cameron
Cameron 2023 年 1 月 2 日
What do you mean by smoothing line? You can take the information from polyfit and use that if it's some polynomial fit, but I'm not sure what your model looks like. I'm also not sure what the second question means.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2023 年 1 月 2 日
I am not certain what you wnat to do.
Taking a guess —
N = 20;
x = sort(randn(1,N));
y = randn(1,N);
xs = linspace(min(x), max(x), 10*N);
ys = interp1(x, y, xs, 'spline'); % Interpolate Using 'spline'
figure
subplot(2,1,1)
plot(x, y, '.')
hold on
plot(xs, ys)
hold off
grid
axis('padded')
title('With Points')
subplot(2,1,2)
plot(xs, ys)
grid
axis('padded')
title('Without Points')
To plot more than one line in one axes, use the hold function. To plot more than one axes in one figure, use subplot, tiledlayout, or stackedplot, depending on what you want to do. (I have illustrated a version all those here.)
.
  5 件のコメント
Max1234
Max1234 2023 年 1 月 3 日
Thank you very much! You helped me a lot!
Star Strider
Star Strider 2023 年 1 月 3 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by