how to plot multiple graphs

1 回表示 (過去 30 日間)
Boss Man
Boss Man 2020 年 2 月 21 日
編集済み: Boss Man 2020 年 2 月 27 日
would a for loop work?
  1 件のコメント
Jacob Wood
Jacob Wood 2020 年 2 月 22 日
A for loop would be perfect. In each loop create the figure and make your plots.

サインインしてコメントする。

回答 (1 件)

Giuseppe Inghilterra
Giuseppe Inghilterra 2020 年 2 月 22 日
編集済み: Giuseppe Inghilterra 2020 年 2 月 22 日
Hi,
you can plot all these figure by using a for loop cycle.
Example:
for ii = 1:180
figure
plot(x,y)
end
In this way at each iteration you create a figure and plot(x,y) your data. For each plot you can define title, xlabel, ylabel, etc.
However, in this way you will display 180 figures and your pc can slow down or it does not manage easily 180 figures opened.
For this reason you could don't display immediately all the figures, you could save them in your current folder and then open which you prefer.
Example:
for ii = 1:180
f = figure('visible','off'); %you don't display figure
plot(x,y)
saveas(f,['Figure' num2str(ii)],'fig') %you save figure in current folder
end
openfig('Figure1','visible') %For example you open and display the first saved figure
Hope this helps.
Note that x,y data depends on how your temperature data are stored.
  2 件のコメント
Giuseppe Inghilterra
Giuseppe Inghilterra 2020 年 2 月 25 日
Do you want one figure for each day or one figure with all days? Can you show me your code?
Giuseppe Inghilterra
Giuseppe Inghilterra 2020 年 2 月 26 日
In your code you don't define what is x and y. Moreover, it seems that you have one temperature value for each day and not a temperature curve for each day. Can you attach '.xlsx' file or a sample from which I could run code on my own? Thank you.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by