Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I want to set axis from gui with a figure that it's plotted in a function. How do I do that?

조회 수: 1 (최근 30일)
So I have a GUI with a pushbutton and two axis. In the pushbutton callback, I placed a code with a function I created that makes some calculus and plots two figures: figure(1) and figure(2).
Something like:
%pushbutton callback:
track_plotter(a,b,c);
and my function is something like: function track_plotter(a,b,c)
%makes calculus with a,b,c
figure (1)
%plots figure(1)
figure(2)
%plots figure(2)
What is happening is that the figures appear in diferent windows as figures instead of appearing in axes1 and axes 2 as I want.
Sorry for my bad English, I don't know if I made myself clear...
Thanks!

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 2일
편집: Azzi Abdelmalek 2013년 3월 2일
plot(handles.axes1,t1,y1)
plot(handles.axes2,t2,y2)
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 2일
You can put handles in your function input argument
function y=fcn(handles,a,b,c)
Flávio
Flávio 2013년 3월 2일
And how do I associate the handles with my figure? My code for figure(1) is:
figure(1)
scatter(PinoA(:,1),PinoA(:,2),20,'ok','filled');
hold on
scatter(PinoB(:,1),PinoB(:,2),20,'ok','filled'); %blue
axis equal
%scatter(Route(:,1),Route(:,2),40,epsilon(:,1),'filled')
%scatter(Route(1:size(Route,1)/nrVoltas,1),Route(1:size(Route,1)/nrVoltas,2),40,'b','filled')
%if 1;%nrVoltas>1
scatter(Route(1:size(Route,1)/nrVoltas,1),Route(1:size(Route,1)/nrVoltas,2),(3-drag_spec(1:length(Route)/nrVoltas))*15, 3.6.*mean(reshape(VelMax(:,3),length(VelMax)/nrVoltas,nrVoltas),2),'filled');
So, I use figure(1) in the beginning and then I use scatter to plot a graphic using some variables that I defined.
How do I associate figure(1) with axes1?

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by