Inserting view into subplot

조회 수: 1 (최근 30일)
Matlab2010
Matlab2010 2013년 3월 11일
I wish to insert a view image into a subplot, as below.
I thought I could do it by passing axis object, but it fails.
How can I do this? thank you
figure;
A = rand(10,10);
subplot(131);
subplot(132);
subplot(133);
%
subplot(131);
imagesc(A);
subplot(132);
view(biograph(sparse(A))); %this opens in a new figure. Not what I want.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 11일
The documentation says specifically that it opens a new figure.
You might be able to find another method by looking at the source (I do not have that toolbox), but otherwise about the only approach would be to let it open a figure and then copyobj() the content of the axes it produces into the subplot and then delete the figure. I would expect that to cause subtle problems, but there might be ways to overcome those problems if you were to examine the source.
  댓글 수: 2
Matlab2010
Matlab2010 2013년 3월 11일
biograph simply returns a handle h.
h = biograph(cm,ids,varargin)
I see from view.m that
% T = VIEW returns the current general 4-by-4 transformation matrix.
%
% VIEW(AX,...) uses axes AX instead of the current axes.
This suggests I may be able to either pass the subplot AX (ie get(gca)) into view or that I can pass the handle h into subplot.m
Walter Roberson
Walter Roberson 2013년 3월 11일
There is a specific view() function for biograph objects.
Use
which -all view
to see location of the other view.m file.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by