id | value1 | value2 |
---|---|---|
id1 | 15 | 19 |
id2 | 15 | 3 |
id3 | 20 | 7 |
id4 | 8 | 14 |
id5 | 13 | 2 |
id6 | 4 | 5 |
id7 | 11 | 11 |
id8 | 17 | 7 |
id9 | 18 | 12 |
id10 | 8 | 3 |
id11 | 1 | 3 |
id12 | 16 | 15 |
Python
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
id | value1 | value2 |
---|---|---|
id1 | 15 | 19 |
id2 | 15 | 3 |
id3 | 20 | 7 |
id4 | 8 | 14 |
id5 | 13 | 2 |
id6 | 4 | 5 |
id7 | 11 | 11 |
id8 | 17 | 7 |
id9 | 18 | 12 |
id10 | 8 | 3 |
id11 | 1 | 3 |
id12 | 16 | 15 |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
plt.scatter(df['value1'], df['value2'], label='value1 vs value2')
plt.xlabel('Value1')
plt.ylabel('Value2')
plt.title('Scatter Plot of value1 and value2')
plt.legend()
plt.show()
# サブプロットを作成
fig, ax = plt.subplots()
# ヒストグラムをプロット
ax.scatter(df['value1'], df['value2'], label='value1 vs value2')
ax.set_xlabel('Value1')
ax.set_ylabel('Value2')
ax.set_title('Scatter Plot of value1 and value2')
ax.legend()
# グラフを表示
plt.show()