How to find the best point (of intersection) of 3 contour lines?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
John D'Errico
el 8 de Jun. de 2023
Editada: John D'Errico
el 8 de Jun. de 2023
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!