필터 지우기
필터 지우기

Customized Legend in Matlab

조회 수: 1 (최근 30일)
BigBang
BigBang 2015년 3월 5일
답변: BigBang 2015년 3월 5일
Here I have a for loop to plot the content of my matrix.
Based on 'type' value I determine the plot object (ks,bO,rX)
for k = 1:length(data1)
if(type(k)==1)
h=plot(data1(k,1),data1(k,2),'ks');set(h,'linewidth',2);hold on;
elseif(type(k) ==0)
h=plot(data1(k,1),data1(k,2),'bO');set(h,'linewidth',2); hold on;
else
h=plot(data1(k,1),data1(k,2),'rX');set(h,'linewidth',2); hold on;
end
end
I am little bit confused to find a way to put legend in my final figure, which shows my own explanation regarding each object(ks,bO,rX). type is just an array of integer which holds (-1,0,1). For example when it is 0 , capital 'O' will be plot. So In Legend I want to mention for example O represent negative values. But I couldn't find anyway to wring a string (as the description) beside O or X or the Square in legend.

채택된 답변

BigBang
BigBang 2015년 3월 5일

추가 답변 (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