How to find the best point (of intersection) of 3 contour lines?
11 ビュー (過去 30 日間)
古いコメントを表示
I have made 3 contour maps using the values in data file attached. The 3 contour lines, with values 7.54, 42.38 and 33.46 (as shown in the plot), are intersecting with each other but not altogether. Is there a way to find a common point (with x-y coordinates) which can be called as the intersection of these 3 lines? Your help will be much appreciated. Thank you
load data
contourf(x1,y1,z1, [900 7.54] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='r');
% 900 value I have input as a dummy value, as when I use only one value, it
% does not show correct contour.
hold on
contourf(x1,y1,z2, [900 42.38] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='g');
contourf(x1,y1,z3, [900 33.46] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='b');
grid on
plot(114,135,'x','color','r') % this point is only for demonstration
3 件のコメント
John D'Errico
2023 年 6 月 8 日
編集済み: John D'Errico
2023 年 6 月 8 日
There is no "best" point. Only you can define that. And once you do define what "best" means, then you can START to find a solution. Until then, best is meaningless. Effectively, you cannot even start to write code until you define what the code should do.
You say you are "aiming along the lines of weighted mean". I'm sorry, but this is still a meaningless statement. A weighted mean of what? Where would weights come from in this context?
There is a set of infinitely many points delineated by those contour lines. That set is not even a simple convex set. Certainly not even a triangular region. It is just a region in the plane. Any point inside that region could arguably be identified as best.
And for example, you might pick the centroid of the region. But if a region is not convex, then the centroid need not even be inside the region. (Consider a U-shaped region, and it need not even be that dramatically shaped. Even something that looks like a half moon would qualify as one where the centroid is not contained inside the region itself.)
I'm sorry, but the simplest solution is to just pick the point that makes sense to you. Click with your mouse at a point that makes you happy. That will be as good as any other measure we could offer.
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!