質問編集履歴

2

変更

2020/04/04 02:37

投稿

pon244
pon244

スコア59

test CHANGED
File without changes
test CHANGED
@@ -44,6 +44,10 @@
44
44
 
45
45
 
46
46
 
47
+ ```
48
+
49
+
50
+
47
51
  【グラフ結果】
48
52
 
49
53
  ![イメージ説明](5cd664dd95b73f6f245b52bc57044cc5.png)

1

code

2020/04/04 02:37

投稿

pon244
pon244

スコア59

test CHANGED
File without changes
test CHANGED
@@ -1,8 +1,20 @@
1
1
  ```ここに言語を入力
2
+
3
+ #>>> %matplotlib inline
2
4
 
3
5
  import numpy as np
4
6
 
5
7
  import matplotlib.pyplot as plt
8
+
9
+ import matplotlib.ticker as ticker
10
+
11
+ plt.gca().get_yaxis().get_major_formatter().set_useOffset(False)
12
+
13
+
14
+
15
+ # X軸の数字が必ず整数になるようにする
16
+
17
+ plt.gca().get_yaxis().set_major_locator(ticker.MaxNLocator(integer=True))
6
18
 
7
19
 
8
20
 
@@ -14,7 +26,13 @@
14
26
 
15
27
  width = 6.0
16
28
 
29
+
30
+
31
+
32
+
17
- # 棒グラフを作成する
33
+ # X軸の数字が必ず整数ようにする
34
+
35
+
18
36
 
19
37
  plt.bar(left, height1, width = width,color="lightblue")
20
38
 
@@ -24,7 +42,7 @@
24
42
 
25
43
  plt.bar(left, height2, bottom=height1, width = width,color="orange")
26
44
 
27
- ```
45
+
28
46
 
29
47
  【グラフ結果】
30
48