App Designer | hold on does not work as expected

5 views (last 30 days)
In live scripts or simple matlab code I normaly draw slice and two plot3 graphics in one axes:
but, using App Designer, it cant draw normally:
1 - only slice, 2 - slice and 2 plot3, 3 - slice and one plot3
code for App Designer: (V - 3-d matrix)
hold on;
colormap(app.fullaxes, map);
s = slice(app.fullaxes, app.y_3, app.x_3, app.z_3, app.V, 0,0,15);
set(s, 'EdgeAlpha',0.1);
plot3(app.fullaxes, y_1, x_1, z_1, 'Color', app.color_2);
plot3(app.fullaxes, y_2, x_2, z_2, 'Color', app.color_3);
hold off;

Accepted Answer

Kevin Holly
Kevin Holly on 17 May 2022
I believe you need to specify the axes of your hold on. Please let me know if this works.
hold(app.fullaxes,'on');
colormap(app.fullaxes, map);
s = slice(app.fullaxes, app.y_3, app.x_3, app.z_3, app.V, 0,0,15);
set(s, 'EdgeAlpha',0.1);
plot3(app.fullaxes, y_1, x_1, z_1, 'Color', app.color_2);
plot3(app.fullaxes, y_2, x_2, z_2, 'Color', app.color_3);
hold(app.fullaxes,'off');

More Answers (0)

Community Treasure Hunt

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

Start Hunting!