Borrar filtros
Borrar filtros

How to shade a portion of a graph

51 visualizaciones (últimos 30 días)
Kyle Langford
Kyle Langford el 5 de Mzo. de 2022
Comentada: Kyle Langford el 5 de Mzo. de 2022
How can I shade under the curve, and after x=1.25?
x=[-3:.1:3]; %
Y=normpdf(x,0,1);
plot(x,Y,'b')
xlim([-3 3])
ylim([0 0.4])
hold on
index=[1.25:3] %area i want shaded
fill(x,Y,index,'g')

Respuesta aceptada

David Hill
David Hill el 5 de Mzo. de 2022
x=[-3:.1:3]; %
Y=normpdf(x,0,1);
plot(x,Y,'b')
xlim([-3 3])
ylim([0 0.4])
hold on
area(x(x>=1.25),Y(x>=1.25),0,'EdgeColor','none','FaceColor','b')

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by