### Tags: bone, comgt, dead, hotmail, ltpeterb, matlab, matrix, peter, play, plot, programming, space, subplot, todaysummary, wrotegt

# Subplot matrix: remove dead space between plot

On Programmer » Matlab

2,548 words with 1 Comments; publish: Sun, 18 May 2008 22:05:00 GMT; (20062.50, « »)

On May 29, 6:09 am, "Peter Bone" <peterb....matlab.todaysummary.com.hotmail.com> wrote:

> 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

*http://matlab.todaysummary.com/q_matlab_58155.html*

All Comments

Leave a comment...

- 1 Comments
- "Jim Rockford" <jim.rockford1.matlab.todaysummary.com.gmail.com> wrote in message
news:1180506155.100697.253990.matlab.todaysummary.com.q75g2000hsh.googlegroups.com...

> On May 29, 6:09 am, "Peter Bone" <peterb....matlab.todaysummary.com.hotmail.com> wrote:

> 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.

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

slord.matlab.todaysummary.com.mathworks.com

#1; Sun, 18 May 2008 22:06:00 GMT

- "Jim Rockford" <jim.rockford1.matlab.todaysummary.com.gmail.com> wrote in message