필터 지우기
필터 지우기

Superimposing contour plot on pcolor

조회 수: 8 (최근 30일)
Bruno Rodriguez
Bruno Rodriguez 2017년 6월 26일
댓글: Bruno Rodriguez 2017년 6월 27일
I am looking to superimpose a contour plot onto a pcolor plot that I have.
The pcolor plot is attached. I'd like to add a contour plot of topography, such that all points below the surface topography (defined by the y axis of the pcolor plot) are filled black (thereby blocking the background pcolor plot in that area). I'm unsure how to go about this, so any help would be much appreciated.

답변 (1개)

Jess Lovering
Jess Lovering 2017년 6월 26일
To clarify, are you saying that you want to impose a black area over regions that are within a certain value range?
If so, then you can use [C,h] = countour(X,Y,Z,[val val]) where "val" is the number you are using as your cut-off value. If it is zero then [C,h] = countour(X,Y,Z,[0 0]) will return a value in C that is the contour line points. You can use that with the area function (ex: area(C(1,:),C(2,:))) to generate a mask of black for those areas. You will have to modify this to fit your exact work but it could be a good starting point.
  댓글 수: 1
Bruno Rodriguez
Bruno Rodriguez 2017년 6월 27일
The variable being plotted in the pcolor plot is reflectivity, and it's plotted in the horizontal and vertical 2D plane. However, what I'm wanting is to superimpose a field whose variable is height (as a function of horizontal distance) onto this pcolor plot. Since it's an entirely different variable to that being plotted in the pcolor plot, I don't believe this approach would work...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by