Remove specific items from legended

조회 수: 6 (최근 30일)
Brian Hoblin
Brian Hoblin 2017년 1월 29일
댓글: Brian Hoblin 2017년 1월 29일
I used the drawArrow function to mark the x and y axis on my plot but I don't want them in the legend. Could someone please tell me how/if it is possible to only have specific items show up in the legend? They show up without any text in the legend but I would prefer that they just don't appear at all in the legend. Thanks.
x1=[0 0.29478297];
x2=[0 9.705216919];
x3=[-3 10];
y3=[1 -10];
m1=1.398248942;
m2=-0.172547385;
y1=m1*x1;
y2=m2*x2;
drawArrow = @(x,y) quiver( x(1),y(1),x(2)-x(1),y(2)-y(1),0,'k' )
x3 = [0 0];
y3 = [-2 1];
drawArrow(x3,y3);
hold on
x4 = [-0.5 10];
y4 = [0 0];
drawArrow(x4,y4)
hold on
plot(x1,y1,x2,y2)
hold on
%grid on
title('Phasor Diagram of Section B Circuit')
legend('','','Capacitor Voltage','Resistor Voltage')
xlabel('Real')
ylabel('Imaginary')

채택된 답변

Iddo Weiner
Iddo Weiner 2017년 1월 29일
yeah, check this out:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by