How to bring a patch to the bottom of a figure?
Mostrar comentarios más antiguos
How to bring a patch to the bottom of a figure?
[EDITED] In the following figure, I would like to have the two lines at the top, while the patch at the very bottom of the figure.
hold on
a = plot([1 2 3],[1 2 3],'color','k','LineWidth',3);
b = plot([4 3 2],1:3,'color','r','LineWidth',3);
c = fill([0 4 5 2 1],[0 0 2 4 3],'y');
hold off
3 comentarios
Les Beckham
el 6 de Mzo. de 2023
Is the figure as shown not what you want? If so, please clarify what should be different about it. The way I see it, the two lines are "on top" of the polygon.
Respuesta aceptada
Más respuestas (1)
The code you originally posted already had the lines on top.
Just plot the lines after the patch.
hold on
c = fill([0 4 5 2 1],[0 0 2 4 3],'y');
a = plot([1 2 3],[1 2 3],'color','k','LineWidth',3);
b = plot([4 3 2],1:3,'color','r','LineWidth',3);
hold off
Categorías
Más información sobre Polygons en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





