필터 지우기
필터 지우기

Subplot a matrix within a single Graph

조회 수: 10 (최근 30일)
Avigdor
Avigdor 2012년 11월 6일
Hi,
I have a matrix with four columns and 40 rows. I want to plot these entries in a single plot with the first column in the upper left corner, the second in upper right left corner, third column in lower left corner, and fourth column in lower right corner of a single graph.
Can someone give a tip or code snippet?
Thanks!
  댓글 수: 2
Jan
Jan 2012년 11월 6일
편집: Jan 2012년 11월 6일
It is not clear, how you want to draw columns in corners. A small example would be helpful. Does the tag "subplot" contain the necessary information? Could you show us, what you have tried so far and which problems occurred?
Avigdor
Avigdor 2012년 11월 6일
Hi,
Yes, you are right. It was not clear.
I have a matrix whose columns represent four sets of "y" data. I want to plot the column "y" data all in the same plot, but divide the plot into quadrants, each quadrant being assigned to one of the columns of "y" data. The "x" data is the same for all.

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

답변 (1개)

Akiva Gordon
Akiva Gordon 2012년 11월 13일
For some random data of 40 rows, 4 columns, this plots a line plot
data = rand(40,4);
for i = 1:size(data,2)
subplot(2,2,i)
plot(data(:,i))
end
To plot only the points (no lines connecting them), use instead:
plot(data(:,1),'.')

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by