Update axes problem in GUI

2 views (last 30 days)
Mus'ab Ahmad
Mus'ab Ahmad on 25 Jun 2015
Commented: Mus'ab Ahmad on 2 Jul 2015
I have a matlab gui that contains 5 plots (axes1 (main), axes2 and axes3 for value Arm (inside panel 17), and another axes4 and axes5 for value Index Table (inside panel 18). Values Lead Screw.., Rack and Pinion and Belt.. are not associated with any plots apart from the main). Axes1 shall be updated (showing 5 different images) if a different value is selected from a popup menu. Other plots shall be appeared (by controlling the visibility on/off of panels 17 and 18) along with the updated axes1 plot if their corresponding values are selected. E.g. if value Arm is selected then 3 plots should appear, the same for value Index Table. Values Lead Screw.., Rack and Pinion and Belt.. show only the axes1 plot.
The problem is: whenever values Arm or Index Table are being selected, their associated 2 plots (axes2 and axes3, or axes4 and axes5) appear fine BUT the main plot (axes1) stopped being updated! even if I select any other value from the popup menu!

Accepted Answer

Walter Roberson
Walter Roberson on 25 Jun 2015
So not imshow(data) but imshow(axes_handle, data) or imshow(data, 'Parent', axes_handle) .
(Better yet if the image is already present then set() it's CData to the new values instead of using imshow() which will remove the old object and create a new one.)
  1 Comment
Mus'ab Ahmad
Mus'ab Ahmad on 2 Jul 2015
It works, thanks a lot :)

Sign in to comment.

More Answers (0)


Find more on Graphics Object Identification in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!