필터 지우기
필터 지우기

Draw solid line around area in contourf

조회 수: 5 (최근 30일)
Emma
Emma 2017년 5월 29일
댓글: Emma 2017년 5월 30일
Hi!
I wonder how I can plot a solid line around areas when using contourf? I use
figure
contour(t,frequency,power,20);
set(gca,'YLim',[5 15]);
colormap(autumn);
to plot power versus frequency and time. In many cases I have nans so the plot has white areas as well. So, I wonder how I can plot a solid line separating the colorful areas from the white (nan) areas? It would kind of be drawing a line around areas in the figure. The power at the border between the white and the areas isn't necessarily the same everywhere (so I can't plot a line when the power equals a certain value).
Thanks!
Emma
  댓글 수: 2
dpb
dpb 2017년 5월 29일
Probably need to attach a data file folks could play with here to get any direct response...and the figure with it would help folks visualize when reading the question--save as .jpg and use the "image" button (the one in color).
Emma
Emma 2017년 5월 30일
Thank you! I will keep this in mind if I'll ask more questions in the future.

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 5월 29일
Perhaps something like
hold on
contour(t, frequency, 0 + isnan(power), [1 1])
hold off
  댓글 수: 1
Emma
Emma 2017년 5월 30일
Thank you! This is exactly what I needed.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by