MATLAB GUI: Axes do not retain modifications when using the plot function
古いコメントを表示
Hi, everyone I'm working on a Matlab GUI, I acquire samples over COM, there is a callback every N samples, then I plot them on GUI. The problem is as follow: in GUI Opening Function I make some axes initializations (axes tick, axes limits, axes labels...) and it's all correct when the GUI is opened but as soon as data are plotted the axes loose the lables and part of the YTick personalization. I've attached the code to discuss with you searching for my possible faults.
%Axes initialization
handles.axes1.YTickMode = 'manual';
handles.axes1.XTickMode = 'manual';
handles.axes1.YLimMode = 'manual';
handles.axes1.XLimMode = 'manual';
ytickformat(handles.axes1,'%.2f');
handles.axes1.XLabel.String = 'Samples';
handles.axes1.YLabel.String = 'Voltage';
handles.axes1.YLim = [0 3.0];
handles.axes1.XLim = [0 1000];
handles.axes1.YTick = [0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0];
handles.axes1.XTick = [0 250 500 750 1000];
%Serial Callback
function serialcallback(hObject)
handles = guidata(hObject);
buffer = fread(handles.serConn, 3000, 'uint16');
j=0;
for k = 1:3:3000
j = j+1;
handles.Volt(j) = double(buffer(k))*(3.0/4095.0);
if k > 1
handles.Temp(j-1) = buffer (k-2);
handles.Curr(j-1) = buffer (k-1);
end
end
plot(handles.axes1,handles.Volt);
guidata(hObject,handles);
Thank you to everyone for the support.
2 件のコメント
Jan
2018 年 6 月 2 日
Please post the relevant part of the code only. It is not efficient to let the readers search for the lines you are talking of. Thanks.
Dario Laezza
2018 年 6 月 2 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!