Thread Subject:
Subplots with one title

Subject: Subplots with one title

From: Hannes Bauer

Date: 13 Feb, 2009 08:15:21

Message: 1 of 8

Hello!

Is it possible to make a figure consisting of subplots with one title on top of all subplots instead of one title for each subplot?

Regards,

Subject: Subplots with one title

From: Dave Brackett

Date: 13 Feb, 2009 09:53:01

Message: 2 of 8

"Hannes Bauer" <pixstamp@gmx.net> wrote in message <gn3a6p$juk$1@fred.mathworks.com>...
> Hello!
>
> Is it possible to make a figure consisting of subplots with one title on top of all subplots instead of one title for each subplot?
>
> Regards,


just title the top subplot, e.g.

figure
a=subplot(2,1,1)
b=subplot(2,1,2)
title(a,'title')

Subject: Subplots with one title

From: DanF211

Date: 13 Feb, 2009 10:50:03

Message: 3 of 8

"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gn3ftt$bh0$1@fred.mathworks.com>...
> "Hannes Bauer" <pixstamp@gmx.net> wrote in message <gn3a6p$juk$1@fred.mathworks.com>...
> > Hello!
> >
> > Is it possible to make a figure consisting of subplots with one title on top of all subplots instead of one title for each subplot?
> >
> > Regards,
>
>
> just title the top subplot, e.g.
>
> figure
> a=subplot(2,1,1)
> b=subplot(2,1,2)
> title(a,'title')

That doesn't really work if there are four subplots because the title will be above the first one, i.e. on the left. It would be nice to have a way of putting the title at the top centre of the figure, regardless of the number/configuration of subplots.

Subject: Subplots with one title

From: Dave Brackett

Date: 13 Feb, 2009 11:26:02

Message: 4 of 8

"DanF211 " <daniel.cromb@iop.kcl.ac.uk> wrote in message <gn3j8r$qdg$1@fred.mathworks.com>...
> "Dave Brackett" <davebrackett@hotmail.com> wrote in message <gn3ftt$bh0$1@fred.mathworks.com>...
> > "Hannes Bauer" <pixstamp@gmx.net> wrote in message <gn3a6p$juk$1@fred.mathworks.com>...
> > > Hello!
> > >
> > > Is it possible to make a figure consisting of subplots with one title on top of all subplots instead of one title for each subplot?
> > >
> > > Regards,
> >
> >
> > just title the top subplot, e.g.
> >
> > figure
> > a=subplot(2,1,1)
> > b=subplot(2,1,2)
> > title(a,'title')
>
> That doesn't really work if there are four subplots because the title will be above the first one, i.e. on the left. It would be nice to have a way of putting the title at the top centre of the figure, regardless of the number/configuration of subplots.


ok, you could use text(x,y,'string') to create a text string on the figure. just would need to get the x and y coordinates for positioning. You could link the x coordinates to the size of the figure window so that it is always in the middle.

Subject: Subplots with one title

From: Dave Brackett

Date: 13 Feb, 2009 11:36:01

Message: 5 of 8

"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gn3lc9$j8g$1@fred.mathworks.com>...
> "DanF211 " <daniel.cromb@iop.kcl.ac.uk> wrote in message <gn3j8r$qdg$1@fred.mathworks.com>...
> > "Dave Brackett" <davebrackett@hotmail.com> wrote in message <gn3ftt$bh0$1@fred.mathworks.com>...
> > > "Hannes Bauer" <pixstamp@gmx.net> wrote in message <gn3a6p$juk$1@fred.mathworks.com>...
> > > > Hello!
> > > >
> > > > Is it possible to make a figure consisting of subplots with one title on top of all subplots instead of one title for each subplot?
> > > >
> > > > Regards,
> > >
> > >
> > > just title the top subplot, e.g.
> > >
> > > figure
> > > a=subplot(2,1,1)
> > > b=subplot(2,1,2)
> > > title(a,'title')
> >
> > That doesn't really work if there are four subplots because the title will be above the first one, i.e. on the left. It would be nice to have a way of putting the title at the top centre of the figure, regardless of the number/configuration of subplots.
>
>
> ok, you could use text(x,y,'string') to create a text string on the figure. just would need to get the x and y coordinates for positioning. You could link the x coordinates to the size of the figure window so that it is always in the middle.

actually, scrub that last comment, you can't use that as that only puts text within an axes, and while you could create an invisible axes the same size as the figure, it would probably be a bit of a pain.

however, there is this function on the file exchange called supertitle which should do what you want: http://www.mathworks.com/matlabcentral/fileexchange/3233

Subject: Subplots with one title

From: Adam A

Date: 11 Mar, 2010 13:58:25

Message: 6 of 8

> however, there is this function on the file exchange called supertitle which should do what you want: http://www.mathworks.com/matlabcentral/fileexchange/3233

The function 'supertitle' doesn't seem to exist in the file exchange any more.

However, the function 'mtit' does the job quite nicely instead:
http://www.mathworks.com/matlabcentral/fileexchange/3218-mtit-a-pedestrian-major-title-creator

Subject: Subplots with one title

From: Arseny

Date: 20 Jul, 2011 00:30:19

Message: 7 of 8

If the subplots don't have titles of their own, this simple code seems to work:

set(gcf,'NextPlot','add');
axes;
h = title('MyTitle');
set(gca,'Visible','off');
set(h,'Visible','on');

Subject: Subplots with one title

From: Paw

Date: 13 Mar, 2013 12:40:07

Message: 8 of 8

> set(gcf,'NextPlot','add');
> axes;
> h = title('MyTitle');
> set(gca,'Visible','off');
> set(h,'Visible','on');

Worked like a charm. Thanks.

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
figure title Adam A 11 Mar, 2010 09:06:23
rssFeed for this Thread

Contact us