***********************************************
figure;
fig = gcf;
for index=1:16
pHandles(index)=subplot(4,4,index);
colormap(mycolormap); % 64x3 colormap
image(zeros(16,16)+33); % Each image is a 16x16 matrix
axis('square'); axis off;
end
set(fig,'DoubleBuffer','on');
***********************************************
Note: I initialize each subplot figure with a blank image, each of
which will be updated
as I collect data for my purposes.
There is quite a bit of dead space between the individual plots. Is
there a reasonably simple way to control the size of each square? I'm
looking for a single control parameter that I can tweak until I like
the sizing. I'm running Matlab 7.1 (sp3).
Thanks,
Jim
This will remove all white space. Play around with the values to give
the right amount.
set(gca,'Position',[0 0 1 1])
Thanks, but this doesn't quite do what I want. It did lead me in the
right direction though. It seems there is no easy, one-line
adjustment to "fatten up" the subplot windows. For each subplot I
used
handle(index) = subplot('Position',[left(index) bottom(index) width
height])
where I had to pre-define left(index) and bottom(index) for each of
the subplots. Pretty tedious stuff, but it works. Matlab really
could use a more convenient graphical interface for this purpose.
Jim
You can do what you want through the figure's regular interface. Create a
set of subplot axes:
subplot(2,1,2); surf(peaks); subplot(2,1,1); plot(1:10)
Click on the arrow (Edit Plot) between the Print button (the button with a
printer as the icon) and the Zoom In button (whose icon is a magnifying
glass with a + symbol in it) in the figure toolbar.
Click on the axes whose position you want to adjust, then drag the corners
or sides of that axes by clicking on the selection handles.
Once you've set up the layout the way you want, if you want to use that
layout for more figures, go to the File menu and select "Generate M-File".
You can then use the generated M-file on its own, or pull out the
appropriate pieces and copy them into your program. You can also save the
figure as a FIG file and reopen it with OPENFIG when you want to use it
later.
--
Steve Lord
sl...@mathworks.com
I think what would be really nice is if Matlab didn't put so much default white space in between subplots. Steve's solution works, but you have to go in and edit by hand. This is incredibly annoying and time consuming. Matlab should just default to much, much less white space in between subplots. I am constantly manually editing subplots to decrease the white space. I have so many routines that create figures automatically, I just wish ML would make the default spacing smaller. What is even more annoying, is if you set the x-axis ticks to not display, it has no effect on the amount of white space in between subplots. It just removes the labels without putting the subplots any closer together.
--Seth
"Seth " <seth.g.cl...@aero.org> wrote in message
news:isju0s$6dp$1...@newscl01ah.mathworks.com...
> "Steven Lord" <sl...@mathworks.com> wrote in message
> <f3k02k$n6s$1...@fred.mathworks.com>...
*snip*
> I think what would be really nice is if Matlab didn't put so much default
> white space in between subplots. Steve's solution works, but you have to
> go in and edit by hand. This is incredibly annoying and time consuming.
> Matlab should just default to much, much less white space in between
> subplots. I am constantly manually editing subplots to decrease the white
> space. I have so many routines that create figures automatically, I just
> wish ML would make the default spacing smaller. What is even more
> annoying, is if you set the x-axis ticks to not display, it has no effect
> on the amount of white space in between subplots. It just removes the
> labels without putting the subplots any closer together.
That sounds like a perfectly reasonable enhancement request to submit to
Technical Support. Explain how frequently you need to modify your figures to
reduce the space and explain how much space you include around an axes in
your application.
--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Hi there,
I'm just beginning to learn Matlab programming. For viewing my data, I need to create a 16 x 8 array of subplots which I have done. But the catch is modifying and resizing all of the subplots simultaneously with a simple statement. I'm having a hell of a time doing this. I want to designate my own x-axis limits without having to click on every single graph. Also, I'm trying to get rid of the dead space between all 128 of my subplots, which seems from your previous conversations that I have to do that manually anyhow. Do you know how to set the x-axis limits at least without having to modify every subplot in the generated code?
Please let me know if you are able to help me out.
Thanks for your time.
Kacey