HMS time with ERRORBAR plot
이전 댓글 표시
Hello,
I can't get any HMS times to work with errorbar, I've spent too much time on this and need help.
The example at:
Does works intermittently and if you zoom then the ticks don't auto adjust. If you click auto so the ticks can readjust then you will lose your HMS time.
Please assist,
Thank you.
답변 (1개)
Walter Roberson
2017년 5월 11일
0 개 추천
You could use a zoom ActionPostCallback https://www.mathworks.com/help/matlab/ref/zoom.html#brux2aq that did a datetick() call
댓글 수: 7
ZBMedina
2017년 5월 23일
Walter Roberson
2017년 5월 24일
Unfortunately zoom objects do not get saved with a figure if you savefig(). I thought for a moment the trick of setting the figure UserData to the zoom object would work, but unfortunately the restored zoom object does not have the information...
Ah, that's it. Set the axes CreateFcn to a little bit of code that adds in the zoom object. Then when the figure gets recreated with openfig(), the zoom object will be built along with the axes.
ZBMedina
2020년 5월 19일
Walter Roberson
2020년 5월 19일
function axes3_CreateFcn(hObject, event)
handles = guidata(hObject);
if ~isfield(handles, 'zoom_obj') || ~isvalid(handles.zoom_obj)
handles.zoom_obj = zoom(ancestor(hObject, 'figure'));
handles.zoom_obj.ActionPostCallback = @(hObject, event) datetick(handles.axes3, 'x');
guidata(hObject, handles);
end
end
ZBMedina
2020년 5월 20일
Walter Roberson
2020년 5월 21일
invoke a function passing in event that does both items for you.
It could be written without a true function (.m) by adding two helper anonymous functions, but there probably is no point in that.
ZBMedina
2020년 5월 21일
카테고리
도움말 센터 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!