Missing patch face color

10 visualizaciones (últimos 30 días)
MirandaB
MirandaB el 14 de Nov. de 2020
Comentada: MirandaB el 15 de Nov. de 2020
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!

Respuesta aceptada

Bruno Luong
Bruno Luong el 14 de Nov. de 2020
Editada: Bruno Luong el 14 de Nov. de 2020
Check if all your data do not contain NaN, Inf or such.
all(isfinite(x(:))) && all(isfinite(yCI95(:))) && all(isfinite(yMean(:)))
  1 comentario
MirandaB
MirandaB el 15 de Nov. de 2020
Ok thanks for the advice!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by