回答編集履歴
2
追記
answer
CHANGED
@@ -9,4 +9,12 @@
|
|
9
9
|
plt.bar(left, height, align="center", width=1.0)
|
10
10
|
plt.show()
|
11
11
|
```
|
12
|
-

|
12
|
+

|
13
|
+
|
14
|
+
【追記】こんな感じでしょうか? ※X軸の順番が期待通りではないかも
|
15
|
+
```Pytohn
|
16
|
+
for idx, row in df.iterrows():
|
17
|
+
plt.bar(df.columns, row.values.tolist(), align="center", width=1.0,tick_label=df.columns)
|
18
|
+
plt.title = df.index
|
19
|
+
plt.show()
|
20
|
+
```
|
1
追記
answer
CHANGED
@@ -1,1 +1,12 @@
|
|
1
|
-
leftとheightは同じ数必要かと思います。(同じ長さの配列にする)
|
1
|
+
leftとheightは同じ数必要かと思います。(同じ長さの配列にする)
|
2
|
+
|
3
|
+
【追記】
|
4
|
+
```Python
|
5
|
+
import matplotlib.pyplot as plt
|
6
|
+
|
7
|
+
left = [1,2,3,4]
|
8
|
+
height = [4,3,2,1]
|
9
|
+
plt.bar(left, height, align="center", width=1.0)
|
10
|
+
plt.show()
|
11
|
+
```
|
12
|
+

|