Eduardo
Eduardo

Reputation: 7141

Matlab: Plotting on two axes on different figures

I have two figures

f1 = figure('visible','off');
f2 = figure('visible','off');

Now I want to get some data [x1Array,y1Array] & [x2Array,y2Array] and plot the first set on figure f1 and the second set on figure f2.

I have tried using:

plot(f1,x1Array,y1Array);
plot(f2,x2Array,y2Array);

but this gives me an error: Error using ==> plot String argument is an unknown option. I think this means that the handle is not what Matlab expected. What am I doing wrong?

Upvotes: 0

Views: 174

Answers (1)

Drake
Drake

Reputation: 857

What about

set(0, 'CurrentFigure', f1)
plot(x1Array, y1Array)
set(0, 'CurrentFigure', f2)
plot(x2Array, y2Array)

Upvotes: 2

Related Questions