Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: text in figures with subplots

Subject: text in figures with subplots

From: Michel Slivitzky

Date: 31 Jul, 2007 10:52:03

Message: 1 of 3

I have a figure with 2x2 subplots and would like to add a text string outside of any of the 4 subplots.

How can I position this text; I always end up with the text in any one of the subplots.

Is it possible

Subject: Re: text in figures with subplots

From: us

Date: 31 Jul, 2007 11:07:30

Message: 2 of 3

Michel Slivitzky:
<SNIP needs text far far away from his/her plots...

one of the solutions

     subplot(2,2,1);
     plot(rand(10,1));
     ah=gca;
     axes('position',[0,0,1,1],'visible','off');
     text(.5,.25,'test');
     axes(ah);

us

Subject: Re: text in figures with subplots

From: Rick Rosson

Date: 31 Jul, 2007 08:19:30

Message: 3 of 3

A slightly modified version that provides additional
handles for greater control and flexibility:

   fig = figure;

   a(1) = subplot(2,2,1);
   p(1) = plot(rand(10,1));

   a(2) = subplot(2,2,2);
   p(2) = plot(rand(10,1));

   a(3) = subplot(2,2,3);
   p(3) = plot(rand(10,1));

   a(4) = subplot(2,2,4);
   p(4) = plot(rand(10,1));

   ax = axes('position',[0,0,1,1],'visible','off');
   tx = text(0.4,0.95,'This is the Header');
   set(tx,'fontweight','bold');






"us " <us@neurol.unizh.ch> wrote in message
news:f8n55i$bph$1@fred.mathworks.com...
> Michel Slivitzky:
> <SNIP needs text far far away from his/her plots...
>
> one of the solutions
>
> subplot(2,2,1);
> plot(rand(10,1));
> ah=gca;
> axes('position',[0,0,1,1],'visible','off');
> text(.5,.25,'test');
> axes(ah);
>
> us


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
code us 31 Jul, 2007 07:10:23
subplot us 31 Jul, 2007 07:10:23
axes us 31 Jul, 2007 07:10:23
text us 31 Jul, 2007 07:10:23
visible us 31 Jul, 2007 07:10:23
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics