how can I change the current axes in a GUI?

Illustration
Tanvishah - 2020-08-05T10:56:41+00:00
Question: how can I change the current axes in a GUI?

Hi, how can I change the current axes in a GUI? I try to use the line function, but I don’t know how to activate the right axes for plotting in the wanted figure. I guess, there should be a simple solution, but I can’t find.

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

Here's one example:

 

axes(handles.axes2); %set the current axes to axes2

axes(h) makes existing axes h the current axes and brings the figure containing it into focus. It also makes h the first axes listed in the figure's Children property and sets the figure's CurrentAxes property to h. The current axes is the target for functions that draw image, line, patch, rectangle, surface, and text graphics objects.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!