質問するログイン新規登録

回答編集履歴

3

修正

2020/08/11 12:03

投稿

tiitoi
tiitoi

スコア21962

answer CHANGED
@@ -10,7 +10,7 @@
10
10
  + ax2.plot(class_value,cum_rel_freq,ls='--',marker='○',color='gray')
11
11
  ```
12
12
 
13
- ax2=plot() ではなく、ax2.plot()
13
+ ax2=grid() ではなく、ax2.grid()
14
14
 
15
15
  ```diff
16
16
  - ax2=grid(visible=False)

2

修正

2020/08/11 12:03

投稿

tiitoi
tiitoi

スコア21962

answer CHANGED
@@ -1,12 +1,29 @@
1
1
  このあたりの使い方がおかしいです。
2
+ plot()、grid() ともに Axes オブジェクトのメソッドです。
2
3
 
4
+ ## 修正箇所
5
+
6
+ ax2=plot() ではなく、ax2.plot()
7
+
8
+ ```diff
9
+ - ax2=plot(class_value,cum_rel_freq,ls='--',marker='○',color='gray')
10
+ + ax2.plot(class_value,cum_rel_freq,ls='--',marker='○',color='gray')
3
11
  ```
12
+
4
- ax2=plot(class_value,cum_rel_freq,ls='--',marker='○',color='gray')
13
+ ax2=plot() ではなく、ax2.plot()
14
+
15
+ ```diff
5
- ax2=grid(visible=False)
16
+ - ax2=grid(visible=False)
17
+ + ax2.grid(visible=False)
6
18
  ```
7
19
 
8
- plot()、grid() ともに Axes オブジェクトのメソッドです。
20
+ marker="○" (全角の○) ではなくmarker="o" (アルファベットの o)
9
21
 
22
+ ```diff
23
+ - ax2.plot(class_value, cum_rel_freq, ls="--", marker="○", color="gray")
24
+ + ax2.plot(class_value, cum_rel_freq, ls="--", marker="o", color="gray")
25
+ ```
26
+
10
27
  ## サンプルコード
11
28
 
12
29
  ```python

1

修正

2020/08/11 12:02

投稿

tiitoi
tiitoi

スコア21962

answer CHANGED
@@ -13,10 +13,6 @@
13
13
  import pandas as pd
14
14
  from matplotlib import pyplot as plt
15
15
 
16
-
17
-
18
-
19
-
20
16
  e_scores = np.array([392, 193, 220, 209, 52, 65, 90, 62, 72, 13, 106, 32, 78,
21
17
  23, 44, 19, 56, 281, 56, 26, 61, 27, 63, 224, 80, 122,
22
18
  38, 34, 30, 39, 79, 11, 15, 31, 19, 26, 53, 10, 174,
@@ -38,7 +34,7 @@
38
34
  ax1.set_xlabel("point")
39
35
  ax1.set_ylabel("Relative frequency")
40
36
  ax2.set_ylabel("Cumulative relative frequency")
41
- # plt.show()
37
+ plt.show()
42
38
  ```
43
39
 
44
40
  ![イメージ説明](a377451687ec04f4e836657446df202f.jpeg)