Smooth edge on contour plot
古いコメントを表示
Hello,
In my contourf plot, I want to cut off values above a certain limit, 61 in this case. In the attached figure, I want to have the figure on the right to look like the figure on the left upto the 61 line. However if I set these values to either zero or nan, the edge will always be tapered. Is there a way display the edge like a smooth contour line, like all others in the figure?
Thanks in advance!
The figure on the left is created by
figure()
contourf(W_chh*10^6,W_ww*10^6,(Twout'))
colorbar
The figure on the right is created by
figure()
Twout(Twout >= 61) = nan;
contourf(W_chh*10^6,W_ww*10^6,(Twout'))
colorbar
7 件のコメント
ADSW121365
2020 年 6 月 15 日
You might be able to force the behaviour by plotting the full graph, then setting an xlim to crop out the extra part of the graph without deforming your curves.
Lars Peters
2020 年 6 月 15 日
編集済み: Lars Peters
2020 年 6 月 15 日
If you want the colors to have the same definition for both plots, you can set the color limits of the second axes to have a range from ~56 to 64 or whatever the range is in the first plot. Currently, "yellow-ish" means ~63 on the plot on the left but the same exact color means ~60 on the plot on the right.
Lars Peters
2020 年 6 月 15 日
Adam Danz
2020 年 6 月 15 日
It sounds like the step-like contour edge at level 61 is part of your data and you want to modify that controur line as if your data doesn't have that feature in it. I'll update my answer with an alternative.
Lars Peters
2020 年 6 月 15 日
Adam Danz
2020 年 6 月 15 日
My updated answer suggests to plot the contour lines without modifying the inputs. Then, after the contrours are plotted, remove the levels greater than your threshold.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!