×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Plotting in a graph control

Plotting in a graph control

Plotting in a graph control

(OP)
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.

RE: Plotting in a graph control

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

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

axes(first_axes)
plot(something)

If you have a number of figures you can plot to a specific figure by using this
figure(figure_number)
plot(something)

RE: Plotting in a graph control

(OP)
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.

RE: Plotting in a graph control

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).

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources