python:matplotlib:データの読み込み
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python:matplotlib:データの読み込み [2018/01/22 23:21] – [プロット] koudai | python:matplotlib:データの読み込み [2021/06/27 22:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
例として2017年の京都の月別平均気温のプロットをしてみましょう。 | 例として2017年の京都の月別平均気温のプロットをしてみましょう。 | ||
- | 左から月、日平均気温、日最高気温、最低気温です。 | + | 左から月、平均気温、最高気温、最低気温です。 |
- | < | + | < |
- | # | + | # |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 10 18.0 | + | 10 18.0 |
- | 11 11.2 | + | 11 11.2 |
- | 12 | + | 12 |
</ | </ | ||
Line 42: | Line 42: | ||
data = np.genfromtxt(" | data = np.genfromtxt(" | ||
- | plt.plot(data[:, | + | plt.plot(data[:, |
- | plt.plot(data[:, | + | plt.plot(data[:, |
- | plt.plot(data[:, | + | plt.plot(data[:, |
+ | plt.title(" | ||
plt.xlabel(" | plt.xlabel(" | ||
plt.ylabel(" | plt.ylabel(" | ||
Line 51: | Line 52: | ||
plt.legend() | plt.legend() | ||
- | plt.show() | + | plt.savefig(" |
</ | </ | ||
{{: | {{: | ||
- | ===== 進んだ使い方 | + | ===== コメント行と区切り文字の変更 |
デフォルトでは行頭が# | デフォルトでは行頭が# | ||
Line 63: | Line 64: | ||
例えば次のようにデータが用意されているとします。 | 例えば次のようにデータが用意されているとします。 | ||
< | < | ||
- | !month | + | !month |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 10, 18.0, | + | 10, 18.0, |
- | 11, 11.2, | + | 11, 11.2, |
- | 12, | + | 12, |
</ | </ | ||
python/matplotlib/データの読み込み.1516630915.txt.gz · Last modified: 2021/06/27 21:59 (external edit)