Shade the region to the left of the graph

5 visualizaciones (últimos 30 días)
Sasha Gomes
Sasha Gomes el 21 de Sept. de 2020
Comentada: Ameer Hamza el 21 de Sept. de 2020
Hi
I am trying to shade the region to the left of the graph. Does anyone know how to go about doing that? It would be a great help.
Thanks
My code is attached below
%Stall Speed
rho = 0.002378; % at sea level
Clmax = 2.7;
Vs = 189.056;
WvS = 0.5*rho*Vs^2*Clmax;
x1 = WvS;
x2 = WvS;
y1 = 0;
y2 = 8;
plot([x1,x2],[y1,y2],'-g')
text(95,1.2,'Stall speed')
axis([0 120 -0.1 2])
xlabel('W/S, lb/ft^2')
ylabel('T/W, lb/lb')
grid on
hold on

Respuestas (1)

Ameer Hamza
Ameer Hamza el 21 de Sept. de 2020
Simplest way is to use patch(). Something like this
%Stall Speed
rho = 0.002378; % at sea level
Clmax = 2.7;
Vs = 189.056;
WvS = 0.5*rho*Vs^2*Clmax;
x1 = WvS;
x2 = WvS;
y1 = 0;
y2 = 8;
plot([x1,x2],[y1,y2],'-g')
text(95,1.2,'Stall speed')
axis([0 120 -0.1 2])
xlabel('W/S, lb/ft^2')
ylabel('T/W, lb/lb')
grid on
hold on
patch([0 x1 x2 0], [0 0 8 8], 'r', 'FaceAlpha', 0.1);
  2 comentarios
Sasha Gomes
Sasha Gomes el 21 de Sept. de 2020
Thankyou !!
Ameer Hamza
Ameer Hamza el 21 de Sept. de 2020
I am glad to be of help!!!

Iniciar sesión para comentar.

Categorías

Más información sobre Triangulation Representation 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