Ways to shade points-delimited area or smooth the edge

2 ビュー (過去 30 日間)
Mitsu
Mitsu 2019 年 9 月 14 日
コメント済み: Adam Danz 2019 年 9 月 23 日
Hi,
I have a plot created from a bunch of points, that looks like this:
The code looks like this:
for k = 1:size(Points,1)
if (certain condition regarding Points' third column)
plot(Points(k,1),surfacePoints(k,2),'.k');
end
end
I am looking for a way to make the whole things smoother. Ideally, it would have no gaps and the outer edge would look smooth. However, creating that many points to achieve that takes too much time, so I wonder if you know of any other plotting tool that would help me obtain the same results.
Thanks!
  6 件のコメント
Mitsu
Mitsu 2019 年 9 月 23 日
Thank you, Adam, that did it!
Adam Danz
Adam Danz 2019 年 9 月 23 日
Great! I copied the solution to the answers section so your question appears as answered.

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

採用された回答

Adam Danz
Adam Danz 2019 年 9 月 23 日
You could create a matrix of y-values where each column corresponds to an x-coordinate (so, plotting column 'n' would results in a vertical stack of points). You can use NaN values as fillers for columns with less data. Then, all you have to do is find the minimum y-value within each column (which is easy like sunday morning). You'll end up with a vector of y values and a vector of the associated x values which you can then plot as a line or interpolate to finer resolution.
You could either smooth it out using smooth() or another method.
Also check out the spline() function.
Or you could fit the blue data points to a sin function (or a sum of sines) if you expect that form.

その他の回答 (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