Customized Legend in Matlab

2 ビュー (過去 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 Center および File ExchangeLegend についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by