Missing patch face color

조회 수: 12 (최근 30일)
MirandaB
MirandaB 2020년 11월 14일
댓글: MirandaB 2020년 11월 15일
Hi there
I am trying to add FaceColor property to a patch, but I must be missing something as only the edges are showing up.
The patch is the 95% confidence interval for a line (to be added later).
My code snippet is:
h = patch([x fliplr(x)], [yCI95(1,:)+yMean fliplr(yCI95(2,:)+yMean)],'b');
Which gives me a line outline of the confidence interval (in black) but no face colour (see plot attached)
I would really appreciate some pointers. I haven't been able to make much of the 'patch' MATLAB pages, and comparing with lines of code in which the patch face colour worked has not clarified the issue for me. Many thanks in advance everyone!

채택된 답변

Bruno Luong
Bruno Luong 2020년 11월 14일
편집: Bruno Luong 2020년 11월 14일
Check if all your data do not contain NaN, Inf or such.
all(isfinite(x(:))) && all(isfinite(yCI95(:))) && all(isfinite(yMean(:)))
  댓글 수: 1
MirandaB
MirandaB 2020년 11월 15일
Ok thanks for the advice!

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

추가 답변 (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