- Contour: https://www.mathworks.com/help/matlab/ref/contour.html
- Clabel: https://www.mathworks.com/help/matlab/ref/clabel.html
PDE Plot for contour lines, for a specific face
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi guys! I am trying to plot a contour plot for my PDE result, like this one:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1330110/image.png)
However, if I only wants contour plot for face 5, how can I do it? Also, is it possible to have the value label directly on the contour lines itself? Thank you so much!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1330115/image.png)
댓글 수: 0
채택된 답변
Zuber
2023년 4월 14일
Hi,
I understand that you want a contour plot for ‘face 5’ and label the values on the contour lines. Assuming that the PDE result is stored in a matrix M, the coordinates for ‘face 5’ can be extracted as follows:-
fc_5 = M( :, :, 5);
Then, the contour plot for ‘face 5’ can be obtained using ‘contour’ function:-
contour(fc_5);
Further, to label the values on contour lines, we can use the function ‘clabel’ as follows:-
[C,h] = contour(fc_5);
clabel[C,h];
For more information regarding ‘contour’ and ‘clabel’ functions, please refer to the documentation links below ,
I hope it answers your query.
댓글 수: 0
추가 답변 (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!