Subplot a matrix within a single Graph
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
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),'.')
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!