How to fit a curve into contour plot?
18 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I would like to fit a curve (draw black line) into a contour plot (please refer to the attachment).
Any suggestions?
Thank you,
Carola
0 件のコメント
採用された回答
John D'Errico
2022 年 4 月 19 日
編集済み: John D'Errico
2022 年 4 月 19 日
Sometimes it is easier to just draw the curve yourself. I say this because the curve you drew might not have been the curve I would have chosen. I might have chosen something that goes more through the middle of the contour lines. And that means that your judgement about where you want the curve to be is most important.
Having said that, I would also point out that the AXIS scaling can be a significant factor in all of this. For example, consider the following set of contours:
To me, it clearly looks like the line I would draw here, using the same logic I think you used, that line would be vertical. Right?
In this second contour plot, the line drawn would absolutely be horizontal, correct?
I drew in lines where I think you would draw them in each case.
But, what if I told you the only difference between those two contour plots was the axis scaling?
[X,Y] = meshgrid(-100:100);
contour(X,Y,Z,[1:5:500]);
All I did then was to carefully change the axis scaling, making the same set of PERFECTLY circular contours, now look like they were pointing in one direction or another.
Look carefully at the axes on the two plots.
So are you still ABSOLUTELY positive where that line belongs? If you are, then just draw it by hand. But I would still be asking if you really do know where that curve belongs?
6 件のコメント
Torsten
2022 年 4 月 19 日
Now use a search to find the maximum value for y, at that specific value of x.
Is it this what is meant by "most energetic part of the signal" ?
Rik
2022 年 4 月 20 日
Thank you for your reply. This comment really helps.
Comment posted as flags by @carola forlini:
Not exactly. What I mean is that the signal presents an interval in which the power is higher. This is the area where I want to fit a curve. Thank you.
その他の回答 (1 件)
KSSV
2022 年 4 月 19 日
Get the contour line coordinates using the contour function and use polyfit. Read about polyfit.
1 件のコメント
Ruya Ulutas
2023 年 2 月 17 日
How can you combine these together? I have a polyfit and view of a trisurface function.
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!