Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!feed116.news.tele.dk!bofh.vszbr.cz!news.radio.cz!newsreader4.netcologne.de!news.netcologne.de!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inser text in graph
Date: Wed, 06 Jun 2012 14:40:24 -0500
Organization: Aioe.org NNTP Server
Lines: 49
Message-ID: <jqobnb$1cv$1@speranza.aioe.org>
References: <jql6gl$lfg$1@newscl01ah.mathworks.com> <jql6l9$s09$1@speranza.aioe.org> <jql7m3$r02$1@newscl01ah.mathworks.com> <jqluve$v0m$1@speranza.aioe.org> <jqm0iv$jvj$1@newscl01ah.mathworks.com> <jqm71i$id0$1@speranza.aioe.org> <jqoakv$oi6$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 0rZPzRY4R/tNyWSYCLAyPA.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:770262

On 6/6/2012 2:22 PM, Sanaa wrote:
> Thanks a lot for your modification. However, when I used legend I got
> one small problem which is:
> the values of the parameters are reversed that is, not in the same order
> as in the plot '' I mean their colors'' and one of them is written
> completely in that color. To see what I mean please run this code
...

 >> for ix=1:3,set(oh(ix*2),'color',color_vec(ix)),end

Seems to work here...I get the above annotation w/ a red,blue,black line 
in that order from the top...

Apparently there's a modification in the internals of legend() between 
versions; what does the above show you for the handles to the legend 
objects?

 >> get(oh,'type')
ans =
     'text'
     'line'
     'line'
     'line'
     'line'
     'line'
     'line'
 >> get(oh(2:end),'color');
 >> ans{:}
ans =
      1     0     0
ans =
      1     0     0
ans =
      0     0     1
ans =
      0     0     1
ans =
      0     0     0
ans =
      0     0     0
 >>

These are the color triplets for the lines; the first two are red, next 
blue, last two black.

If they are indeed different, then you'll have to look into them and see 
which ones you need to change.

--