Hi I have a function in callback of app designer that returns few figures. How do i plot them in UIAxes. I know that it is possible to use plot(app.UIAxes, x, y) but I havent got access to x and y coordinates of this figure.
Thank you for all your help

댓글 수: 6

Walter Roberson
Walter Roberson 2023년 9월 15일
What do you have access to?
Adam Danz
Adam Danz 2023년 9월 15일
How are the figures generated within the callback?
Michal
Michal 2023년 9월 15일
this is the callback
Michal
Michal 2023년 9월 15일
% Wyświetlenie trasy
f2 = figure('Visible','off');
ax2 = axes(f2);
hold(ax2,'on')
grid(ax2,'on')
plot(ax2,XYVAL(:,1),XYVAL(:,2));
hold(ax2,'off')
gpsDatafigures{2,1} = f2;
and that is how the one of them is generated
Adam Danz
Adam Danz 2023년 9월 15일
> plot(ax2,XYVAL(:,1),XYVAL(:,2));
Those are the x and y coordinates. Why don't you have access to them?
Michal
Michal 2023년 9월 15일
my function generateTrack returns only the figure not the coordinates. It possible to access this x, y coordinates from the figure level or i need to change the function so that it would return coordinates?

댓글을 달려면 로그인하십시오.

 채택된 답변

Adam Danz
Adam Danz 2023년 9월 15일

0 개 추천

> Is it possible to access this x, y coordinates from the figure level or do I need to change the function so that it would return coordinates?
It's possible to extract the data from the figure but it's much better to return the values from the function.
function [___, x, y] = generatTrack(__)
...
x = XYVAL(:,1);
y = XYVAL(:,2);
plot(ax2,x,y);
end
or
function [___, XYVAL] = generatTrack(__)
...
plot(ax2,XYVAL(:,1),XYVAL(:,2));
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

질문:

2023년 9월 15일

답변:

2023년 9월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by