回答編集履歴
3
追記
test
CHANGED
@@ -33,3 +33,35 @@
|
|
33
33
|
plt.show()
|
34
34
|
|
35
35
|
```
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
numpy使いたくない場合はこちら
|
40
|
+
|
41
|
+
```python3
|
42
|
+
|
43
|
+
import matplotlib.pyplot as plt
|
44
|
+
|
45
|
+
%matplotlib inline
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
x = [*range(1,6)]
|
50
|
+
|
51
|
+
y = [X**2 for X in x]
|
52
|
+
|
53
|
+
y2 = [(X**2)/2 for X in x]
|
54
|
+
|
55
|
+
y3 = [(X**2)/3 for X in x]
|
56
|
+
|
57
|
+
plt.plot(x, y)
|
58
|
+
|
59
|
+
plt.plot(x, y2)
|
60
|
+
|
61
|
+
plt.plot(x, y3)
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
plt.show()
|
66
|
+
|
67
|
+
```
|
2
コード修正
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
x = np.array(range(1,6))
|
20
20
|
|
21
|
-
y =
|
21
|
+
y = x**2
|
22
22
|
|
23
23
|
|
24
24
|
|
1
修正
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
x = np.array(
|
19
|
+
x = np.array(range(1,6))
|
20
20
|
|
21
21
|
y = np.array([X **2 for X in x])
|
22
22
|
|