Borrar filtros
Borrar filtros

filling in between two curves with different x values

6 visualizaciones (últimos 30 días)
Jason
Jason el 12 de Mzo. de 2018
Comentada: Star Strider el 12 de Mzo. de 2018
Hello.
I have a plot
plot(x,y,'r--','LineWidth', 2);
that I want to display with boundaries such that:
plot(x+5,y,'k--','LineWidth', 0.5);
plot(x-5,y,'k--','LineWidth', 0.5);
I want to shade the area in between and have tried:
patch([k-5 k+5], [y y], 'g')
but I can't get it to work.
Thanks for any help.

Respuesta aceptada

Guillaume
Guillaume el 12 de Mzo. de 2018
I would think that
patch([x-5, fliplr(x+5)], [y fliplr(y)], 'g')
should work.
  8 comentarios
Jason
Jason el 12 de Mzo. de 2018
Thankyou for reminding me about Mr Hosptial!
Jason
Star Strider
Star Strider el 12 de Mzo. de 2018
We’re all in this together!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by