필터 지우기
필터 지우기

Send plot from one axes to another

조회 수: 23 (최근 30일)
Álvaro Pauner Argudo
Álvaro Pauner Argudo 2018년 2월 20일
댓글: Álvaro Pauner Argudo 2018년 2월 20일
Is it possible to send a plot from one axes to another in order to see it bigger? I'm able to send the axes to a new figure, as follows:
if true
axes(handles.axes_cam1)
fig=figure;ax=axes;clf;
new_handle=copyobj(handles.axes_cam1,fig);
set(gca,'ActivePositionProperty','outerposition')
set(gca,'Units','normalized')
set(gca,'OuterPosition',[0 0 1 1])
set(gca,'position',[0.1300 0.1100 0.7750 0.8150])
end
But what I want is to send it to other axes that already exist (handles.axes_graficos) and I'm not able with copyobj maybe because I'm doing something wrong.
The target is to avoid repeating the code in the other axes.
  댓글 수: 2
Jan
Jan 2018년 2월 20일
편집: Jan 2018년 2월 20일
Maybe you have a bug in your code using copyobj to copy the line object. Give us a chance to find it by posting the failing code, not some other code which runs successfully. Please explain "I'm not able with copyobj" with details: Do you get an error or does the result differ from your expectation?
What does "repeating the code in the other axes" mean? Code appears in the program text, not in an axes.
Álvaro Pauner Argudo
Álvaro Pauner Argudo 2018년 2월 20일
Sorry, I can't send you the code right now because I don't have here the computer where I'm programming this.
Excuse me for my explanation, I start again. I'm writing an SPC program using guide. I have one tab where you can see four SPC and plot new samples (as you can see in the attached image), but those plots are small, so I have created another tab with one bigger plot, in order to see the small plots better and, with a pop-up menu, select one of the four graphs. For doing this, I could "repeat the code in the other axes", I mean, extract the points plotted in the small axes and plot them in the big one, recycling some of my functions. As I want the same plot but bigger, I was wondering if using copyobj I could do this instead of writting more code lines.
My main problem is that I don't understand well how copyobj works, because I don't want to send the axes from one figure to another, what I want is to send the small axes to the big axes but both in the same figure.
Maybe I'm saying a lot of things that have no sense because I'm new using Matlab.

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

답변 (1개)

Jan
Jan 2018년 2월 20일
편집: Jan 2018년 2월 20일
This copies the line objects from Axes1 to Axes2 using copyobj:
Fig1 = figure;
Axes1 = axes;
LineH = plot(1:10, rand(1, 10));
Fig2 = figure;
Axes2 = axes;
copyobj(LineH, Axes2)

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by