- hold(handles.axes1,'on') in PB10 code...
- Use low-level |line() instead of plot in PB10...
Plot 2 graph in GUI in a axes
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everyone,
I'm creating a Matlab guide and trying to creat an axes and 2 push button. First, I want to press pushbutton9, a graph will appear, then I press the pushbutton10, i want the second graph will also appear on the axes when the first is still here to compare 2 graph. I'm using the 'hold on' function but whenever I press the pushbutton 10, the first graph disappears. Can anyone help me so this problem?
Thank you so much.
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
dataset = xlsread('data.xlsx','Sheet1','A1:B450');
oil = dataset(:,1)
day = dataset(:,2)
plot(handles.axes1,day,oil)
hold on
% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
data = xlsread('data.xlsx','Sheet1','A2:H450');
day = data(:,2);
oil = data(:,8);
plot(handles.axes1,day, oil,'r')
1 Commento
dpb
il 1 Giu 2019
Try
Risposte (0)
Vedere anche
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!