Thread Subject: Figure vs axis handles?

Subject: Figure vs axis handles?

From: David Doria

Date: 10 Apr, 2008 14:26:31

Message: 1 of 5

f=figure;
BottomLeftPlot = subplot('Position', [.05 .1 .4 .4]);

I can set some properties like this:
xlim(BottomLeftPlot, [-180 180]);

and some like this:
set(BottomLeftPlot, 'XLimMode', 'manual');

but some dont work at all?
set(BottomLeftPlot, 'YLabel', 'beta');

Is there a good tutorial somewhere about which properties
belong to the figure, which belong to the axis (or is it
axEs?) and how to set them?

Thanks!

Dave

Subject: Figure vs axis handles?

From: avan

Date: 10 Apr, 2008 14:31:09

Message: 2 of 5

On Apr 10, 4:26 pm, "David Doria" <daviddo...@gmail.com> wrote:
> f=figure;
> BottomLeftPlot = subplot('Position', [.05 .1 .4 .4]);
>
> I can set some properties like this:
> xlim(BottomLeftPlot, [-180 180]);
>
> and some like this:
> set(BottomLeftPlot, 'XLimMode', 'manual');
>
> but some dont work at all?
> set(BottomLeftPlot, 'YLabel', 'beta');
>
> Is there a good tutorial somewhere about which properties
> belong to the figure, which belong to the axis (or is it
> axEs?) and how to set them?
>
> Thanks!
>
> Dave

Yes, if you open the help browser and look under "Handle Graphics
Property Browser". Hope it helps.


avan

Subject: Figure vs axis handles?

From: David Doria

Date: 10 Apr, 2008 15:14:08

Message: 3 of 5

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.

Dave

Subject: Figure vs axis handles?

From: Bruno Luong

Date: 10 Apr, 2008 17:54:02

Message: 4 of 5

"David Doria" <daviddoria@gmail.com> wrote in message
<ftlas0$ke9$1@fred.mathworks.com>...
>
> doesn't work:
> set(BottomLeftPlot, 'Title', 'OnCircle');
>
> works fine:
> set(BottomLeftPlot, 'Title', text('String','OnCircle'));
>

Go to help page and type "axes properties" in the search
box, in the description of "title" property, the help file
states that the value must be a handle, and not a string.

text('String','OnCircle') returns a handles.

Bruno

Subject: Figure vs axis handles?

From: Steven Lord

Date: 10 Apr, 2008 20:45:53

Message: 5 of 5


"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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com