altes4ia
altes4ia

Reputation: 1

Changing axes and color of plots in Matlab

How do you get rid of the axes and dotted line grids when you plot in Matlab? Also, how do I make subplots of subplots. Since that's probably not very clear, what I mean is the following...

Let's say I have a 10x10x10 .mat file, so I open each of the 10 frames and plot what I have on each 10x10 frame. I generate 2 different plots for each frame so that in total there are 20 plots. For each frame I generate 2 subplots. When I run the code, I get 10 different figures with 10 subplots. I'd like to get for this example 1 figure with 20 subplots where the first two refer to the first iteration, second two refer to the second, etc.

for i = 1:10

z=z(:,:,i);
figure(i)
subplot(1,2,1)
surf(z)

%code, obtain new array...

subplot(1,2,2)
surf(new)

end;

Upvotes: 0

Views: 1129

Answers (1)

Jacob
Jacob

Reputation: 34621

You can hide the axes with

set(gca,'Visible','off')

And if you want 20 subplots, try the following:

for i = 1:10

z=z(:,:,i);
subplot(10,2,2*i-1)
surf(z)

%code, obtain new array...

subplot(10,2,2*i)
surf(new)

end

When you use figure(i), you're referring to Figure i which will be created if it does not exist. And with subplot you can specify the ordering of the subplots with the first two arguments.

Note:

20 subplots on one figure are not going to be pretty --- you probably won't be able to see anything, so you should probably break it up into several figures.

Upvotes: 1

Related Questions