How do shade different area with specific y interval
Mostrar comentarios más antiguos
My codes are as follows:
clear
x = 0:0.01:9;
y = sqrt(x);
plot(x, y)
hold on;
x = 1:0.01:9;
[m n]=size(x)
y1=ones(1,n);
plot(x,y1,'r--')
hold on
x = 4:0.01:9;
[m n]=size(x)
y2=ones(1,n)*2;
plot(x,y2,'r--')
hold on
text(2.8, 2,'$y=\sqrt x$', 'interpreter','latex')
text(5.5, 0.2,'Shade this area by green')
text(5.5, 1.2,'Shade this area by red')
text(5.5, 2.2,'Shade this area by blue')
1 comentario
Wan-Yi Chiu
el 25 de Ag. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Labels and Annotations en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
