nico1234
nico1234

Reputation: 9

How to plot multiple figures in one window on MATLAB

I have three figures of gps data I have plotted on a map using the geobubble function.I am trying to represent the number of plastics at different survey locations.

I would like to present these in one figure but i can only get them to open in separate figure windows.

If anyone could help that would be great. Thank you!

Upvotes: 0

Views: 6292

Answers (2)

Abdurrehman
Abdurrehman

Reputation: 1

If you have latest(2016 or above ver.) matlab installed. You can select yyaxis right/left before plotting the data. e.g. yyaxis right, plot(your 1st data), yyaxis left, plot(your 2nd data).

for a old ver of Matlab you can use plotyy();

For plotting n dimension data you can make a vector befor passing on to plot() function.

Hope this will work...

Upvotes: 0

Doresoom
Doresoom

Reputation: 7458

The subplot function does what you want.

For example, if you want a figure with two axes arranged in a 2x1 matrix:

figure
ax(1) = subplot(2,1,1);
[Plot things...]
ax(2) = subplot(2,1,2);
[Plot more things]

Or if you want them all graphed on the same axes, just use the hold function.

figure
hold on
plot(x1,y1)
plot(x2,y2)
etc...

Upvotes: 1

Related Questions