I am trying to implement a "hold on" feature in my gui where the user can select and set of data and plot it on the same graph as the previous data. I saw one forum on here that helped but I am running into an issue. The code is:
ah = findobj(0,'Type','axes','Tag','MyPlotAxes');
if isempty(ah)
fh = figure('Name','Simulation','NumberTitle','off');
ah = axes('Parent',fh, 'Tag', 'MyPlotAxes');
hold(ah, 'on');
end
plot(ah, x, y);
The two sets of data do plot on one graph, however the axes of the figure becomes pasted as the background of the GUI. I have tried redefining the axes specific to each plot but have had no luck.
10 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413433
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413433
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413450
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413450
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413458
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413458
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413465
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413465
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413467
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413467
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413468
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413468
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413471
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413471
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413488
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413488
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413502
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413502
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413687
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/316718-hold-plot-after-each-push-button-press-gui#comment_413687
Sign in to comment.