Hold plot for several different cases
Ältere Kommentare anzeigen
Hi, I have created a GUI where a case is selected from a popup menu, points are calculated according to this case and a plot is drawn once a button "START" is pushed. I would now like to hold plots each time the button START is pushed, i.e. I want to be able to compare the plots between different cases.
This is what my function file looks like:
function [ ] = plot_calc(x, y, z, name, color, handles )
plot(handles.plot,x,y,'DisplayName',name,'Color',color);
box(handles.plot,'on');
grid(handles.plot,'on');
%hold(handles.plot,'all');
xlabel(handles.plot,'Axis(mm)','FontSize',10);
ylabel(handles.plot,'Deformation','FontSize',10);
Where do I have to insert the hold-command? Or what do I have to do to keep the graphs?
Thank you!!
Antworten (2)
Titus Edelhofer
am 3 Feb. 2015
Hi,
the simplest would be to add after the plot command:
plot(handles.plot,x,y,'DisplayName',name,'Color',color);
hold(handles.plot, 'on');
Titus
Frank
am 3 Feb. 2015
0 Stimmen
3 Kommentare
Titus Edelhofer
am 3 Feb. 2015
Interesting. Should be either a call to "hold" or someone setting the "NextPlot" property of handles.plot ('replace' instead of 'add').
Titus
Frank
am 3 Feb. 2015
Titus Edelhofer
am 3 Feb. 2015
Jepp, forgot to add cla to the list above ;-). If everything works, you might mark the question as answered then ...
Titus
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!