Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Figure vs axis handles?
Date: Thu, 10 Apr 2008 16:45:53 -0400
Organization: The MathWorks, Inc.
Lines: 33
Message-ID: <ftlua1$leh$1@fred.mathworks.com>
References: <ftl82n$efq$1@fred.mathworks.com> <39ea46a8-5e83-4ead-8c54-23dc3967f055@c19g2000prf.googlegroups.com> <ftlas0$ke9$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1207860353 21969 144.212.105.187 (10 Apr 2008 20:45:53 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 Apr 2008 20:45:53 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:462291




"David Doria" <daviddoria@gmail.com> wrote in message 
news:ftlas0$ke9$1@fred.mathworks.com...
> Thanks, thats really helpful - here is the solution to my
> problem:
>
> doesn't work:
> set(BottomLeftPlot, 'Title', 'OnCircle');
>
> works fine:
> set(BottomLeftPlot, 'Title', text('String','OnCircle'));
>
> it seems matlab should be able to recognize that 'OnCircle'
> should be treated as a text string... but apparently it can't.

Correct.  The Title property of an axes stores the handle to a text object, 
and that text object stores the string that is displayed as the title.  You 
could use the method you described above, or you could use:

set(get(BottomLeftPlot, 'Title'), 'String', 'OnCircle')

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#Title

Or, of course, you could use the TITLE function, which accepts as one of its 
inputs a handle to the axes whose title you want to set or change.  If 
you're going to be modifying the title frequently, you can also return the 
title text object's handle from TITLE and use SET on it directly later on.

-- 
Steve Lord
slord@mathworks.com