Thread Subject: many plots side by side in one figure

Subject: many plots side by side in one figure

From: lars Man

Date: 24 Apr, 2008 17:54:02

Message: 1 of 5

Hi all,
my problem is, that i got many plots in many Figures (about
24 pies in 12 Figures splited with subplots) but what i
need is, show them all in just one figure, each next to
each other.
But all i get is many small plots, difficult to see. What i
need now is a SLIDER under all plots in this figure. So the
pies coud be bigger and i can show them all in just one
figure.

Thanks for your help

Subject: many plots side by side in one figure

From: alessandro mura

Date: 25 Apr, 2008 08:37:15

Message: 2 of 5

"lars Man" <larsman@gmx.net> wrote in message
news:fuqhfq$fcm$1@fred.mathworks.com...
> Hi all,
> my problem is, that i got many plots in many Figures (about
> 24 pies in 12 Figures splited with subplots) but what i
> need is, show them all in just one figure, each next to
> each other.
> But all i get is many small plots, difficult to see. What i
> need now is a SLIDER under all plots in this figure. So the
> pies coud be bigger and i can show them all in just one
> figure.
>
> Thanks for your help

You can start from something like:

N=20; % number of figures

for i=1:N

axes('position',[.1+i-1 .3 .8 .6],'Tag','myplot','nextplot','add')

plot(cumsum(randn(1,100))) % plot something

title(num2str(i))

box on

end


% the callback function

myfun='value=get(findobj(''tag'',''myslider''),''value'');h=findobj(''tag'',''myplot'');
h=sort(h); for i=1:numel(h); set(h(i),''position'',[.1+i-1-value .3 .8 .6]);
end';


% creates the slider

h=uicontrol('style','slider',...

'units','normalized',...

'position',[.1 .1 .8 .1],...

'max',N-1,...

'min',0,...

'callback',myfun,...

'tag','myslider')


--
Alessandro Mura
Istituto Nazionale di Astrofisica - IFSI
http://pptt4.ifsi-roma.inaf.it/~mura/index.html
http://www.alessandromura.it


Subject: many plots side by side in one figure

From: lars Man

Date: 25 Apr, 2008 18:45:04

Message: 3 of 5

"alessandro mura" <fake@address.com> wrote in message
<fus57j$tae$1@aioe.org>...
> "lars Man" <larsman@gmx.net> wrote in message
> news:fuqhfq$fcm$1@fred.mathworks.com...
> > Hi all,
> > my problem is, that i got many plots in many Figures
(about
> > 24 pies in 12 Figures splited with subplots) but what i
> > need is, show them all in just one figure, each next to
> > each other.
> > But all i get is many small plots, difficult to see.
What i
> > need now is a SLIDER under all plots in this figure. So
the
> > pies coud be bigger and i can show them all in just one
> > figure.
> >
> > Thanks for your help
>
> You can start from something like:
>
> N=20; % number of figures
>
> for i=1:N
>
> axes('position',[.1+i-
1 .3 .8 .6],'Tag','myplot','nextplot','add')
>
> plot(cumsum(randn(1,100))) % plot something
>
> title(num2str(i))
>
> box on
>
> end
>
>
> % the callback function
>
> myfun='value=get(findobj
(''tag'',''myslider''),''value'');h=findobj
(''tag'',''myplot'');
> h=sort(h); for i=1:numel(h); set(h(i),''position'',[.1+i-
1-value .3 .8 .6]);
> end';
>
>
> % creates the slider
>
> h=uicontrol('style','slider',...
>
> 'units','normalized',...
>
> 'position',[.1 .1 .8 .1],...
>
> 'max',N-1,...
>
> 'min',0,...
>
> 'callback',myfun,...
>
> 'tag','myslider')
>
>
> --
> Alessandro Mura
> Istituto Nazionale di Astrofisica - IFSI
> http://pptt4.ifsi-roma.inaf.it/~mura/index.html
> http://www.alessandromura.it
>
>
Hi,
thanx for your help. But there must be a mistake in the
callbackfunction.
And i can't get it running
myfun='value=get(findobj... ???


Subject: many plots side by side in one figure

From: matt dash

Date: 25 Apr, 2008 19:37:01

Message: 4 of 5

It looks like the myfun line should be one long string
definition, not multi-line like it's showing up here. Put it
all on one line and see if it works.

Subject: many plots side by side in one figure

From: lars Man

Date: 29 Apr, 2008 19:26:01

Message: 5 of 5

Thank YOU very much!!!!


You are genius

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

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.

Contact us at files@mathworks.com