Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plotting in a graph control

Status
Not open for further replies.

DSPdude

Electrical
Jul 24, 2003
4
How do I use the Plot function to plot in the graph control of my choosing? I can't seem to find it in the help. Thanks.
 
Replies continue below

Recommended for you

You need to activate the desired axes. For example...

Code:
first_axes = suplot(211);
...
second_axes = subplot(212);
...
If you now call the plot function it will plot i the second_axes since it is the last active axes (which can also be retrieved by the gca-command).
To plot in the first_axes you need to call the axes-function first. That is

Code:
axes(first_axes)
plot(something)
If you have a number of figures you can plot to a specific figure by using this
Code:
figure(figure_number)
plot(something)
 
First of all thanks for the help. However, that's not exactly what I meant.

I have made a form in GUIDE on which I have 4 axes (graphs), and i don't know how to get the Plot function to plot on the graph of my choosing...sorry if I'm being a bit slow, I'm new to MATLAB.

Thanks.
 
OK, I see...

Just set the TAG-property of you axes. And then you can retrieve it by using the findobj-function,

first_axes = findobj(figure_handle,'Tag','Tag of first axes')

which can be used the same way as I explained i my previous post.

The figure_handle is either the figure number or the name of the figure (string).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor