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.
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
Plotting in a graph control
|
RE: Plotting in a graph control
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
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
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).