How to plot several sets of data?

There are 3 sets of data. Each set of data has 5 columns one column is bacteria counts and another is the day. How would you plot the day vs the bacteria counts for all three sets of data?

回答 (1 件)

Star Strider
Star Strider 2014 年 6 月 25 日

0 投票

I would use subplot. I don’t know how your data are organized otherwise, so I can’t be more specific than that.
For example, if your data sets are Data1...Data3, the days are in column 1 and the counts are in column 2, this would work:
figure(1)
subplot(3,1,1)
plot(Data1(:,1), Data1(:,2))
subplot(3,1,2)
plot(Data2(:,1), Data2(:,2))
subplot(3,1,3)
plot(Data3(:,1), Data3(:,2))

6 件のコメント

Dustin
Dustin 2014 年 6 月 25 日
I'm not familiar with subplot. For example what does subplot (3,1,1) mean in this situation?
Joseph Cheng
Joseph Cheng 2014 年 6 月 25 日
subplot(3,1,1) means it will setup a subplot 3 rows by 1 column and set position 1. If you check the link Star Strider has for subplot it does a good job at explaining how to use subplot.
Dustin
Dustin 2014 年 6 月 25 日
Thank you
Star Strider
Star Strider 2014 年 6 月 25 日
Thank you Joseph!
Joseph Cheng
Joseph Cheng 2014 年 6 月 25 日
? you're the one that answered. I just happened to swing by during my usual progress bar boredom.
Star Strider
Star Strider 2014 年 6 月 25 日
True, but I appreciate your contribution. I was away for a few minutes.

この質問は閉じられています。

タグ

質問済み:

2014 年 6 月 25 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by