- Use imagesc, hold, and contour;
- Use the contourf (fills the contours) function only on (x,y,z).
Contour lines on a imagesc plot
조회 수: 27 (최근 30일)
이전 댓글 표시
Hi,
I am plotting a imagesc with (x, y, Z). On top of that I would like to plot the contour lines with constant values of z. Could you please help me with it? Thanks a lot in advance.
댓글 수: 0
답변 (1개)
Star Strider
2017년 1월 18일
There is not enough information in your Question to provide a definite Answer.
Two possibilities:
댓글 수: 2
Star Strider
2017년 1월 18일
You can specify the contour line locations in contour and contourf:
contour(x, y, z, [0.1 0.2 0.3 0.4])
Extend the vector (or use the colon operator or linspace to create an equally-spaced vector) to as many contour lines as you want,at whatever level you want. Contour lines that are out-of-range will of course not be plotted, but they will not throw an error.
See the contour documentation for details.
참고 항목
카테고리
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!