Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
title location

Subject: title location

From: maltake

Date: 21 Jun, 2006 12:59:16

Message: 1 of 4

Hey everyone,

Is there some property for the title command like the 'Location'
property for the legend command? What I want is to put the title of
a plot top-center, but inside the plot area (inside the frame)...

thanks.

Subject: title location

From: Fangjun Jiang

Date: 21 Jun, 2006 14:06:44

Message: 2 of 4

maltake wrote:
>
>
> Hey everyone,
>
> Is there some property for the title command like the 'Location'
> property for the legend command? What I want is to put the title
> of
> a plot top-center, but inside the plot area (inside the frame)...
>
> thanks.

You can do it manually. In the figure, click Edit and then Figure
Properties... You can drag and drop the title box anywhere in the
figure.

You can also do it through script.
handle=title('abc')
set(handle,'Position',[x,y,z]);

Pay attention to the unit.

Subject: title location

From: maltake

Date: 21 Jun, 2006 16:29:22

Message: 3 of 4

Fangjun Jiang wrote:
>
>
> maltake wrote:
>>
>>
>> Hey everyone,
>>
>> Is there some property for the title command like the
'Location'
>> property for the legend command? What I want is to put the
> title
>> of
>> a plot top-center, but inside the plot area (inside the
frame)...
>>
>> thanks.
>
> You can do it manually. In the figure, click Edit and then Figure
> Properties... You can drag and drop the title box anywhere in the
> figure.
>
> You can also do it through script.
> handle=title('abc')
> set(handle,'Position',[x,y,z]);
>
> Pay attention to the unit.
  

Thanks Fangjun Jiang,

I have been doing it manually... I wanted a more automated (and
quick) way of doing it. Right now it's okay, but I plan on working
with close to 100 figures of different sizes, so... I could whip up
a script to get the figure size (axis command) and move the title to
top center using the Position property; But what I was really hoping
for would be something simple like with the legend command:
legend(...,'Location',NorthWest)
inside the box near top left, etc...

Thanks!

Subject: title location

From: PT

Date: 21 Jun, 2006 18:17:13

Message: 4 of 4

This may work.

figure(1) % your figure
v = axis;
handle=title('abc')
set(handle,'Position',[v(1)*1.2 v(4)*.8 0]);

Tags for this Thread

No tags are associated with this thread.

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.

Contact us