Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Plot several curves on two axes in a GUI

Subject: Plot several curves on two axes in a GUI

From: Herve

Date: 5 May, 2009 09:51:01

Message: 1 of 1

Hello,

I have a GUI with two axes. I want to plot several curves on my axes.

My problem is the following : it plots only one curve to my axes. Why ?

If I remove my second axes then it works fine and I get all my curves in my first axes.

My code looks the following :

fig = figure('Position',[150,150,1000,800]);
axes_1 = axes('Parent',fig, 'Position',[275 300 250 400]);
axes_2 = axes('Parent',fig, 'Position',[575 300 250 400]);
my_function(axes_1)

------------------

my_function(axes_handle)

ColorSet = [
0.00 0.00 1.00
0.00 0.50 0.00
1.00 0.00 0.00
];
set(gca, 'ColorOrder', ColorSet);
hold all;

for i=1:3
    x = ...
    y = ...
    plot(axes_handle,x,y)
end

end

-------------

Best regards,

Herv

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us