回答編集履歴
2
d
answer
CHANGED
@@ -41,4 +41,51 @@
|
|
41
41
|
ax.set_xticks([], minor=True)
|
42
42
|
```
|
43
43
|
|
44
|
-

|
44
|
+

|
45
|
+
|
46
|
+
## 追記
|
47
|
+
|
48
|
+
```python
|
49
|
+
import pandas as pd
|
50
|
+
|
51
|
+
df = pd.DataFrame(
|
52
|
+
{
|
53
|
+
"Store": [
|
54
|
+
"shop1",
|
55
|
+
"shop2",
|
56
|
+
"shop3",
|
57
|
+
"shop4",
|
58
|
+
"shop5",
|
59
|
+
"shop6",
|
60
|
+
"shop7",
|
61
|
+
"shop8",
|
62
|
+
"shop9",
|
63
|
+
"shop10",
|
64
|
+
],
|
65
|
+
"Guest": [45, 132, 78, 154, 39, 57, 83, 117, 96, 44],
|
66
|
+
"Outer": [0, 4, 1, 5, 0, 1, 0, 8, 2, 0],
|
67
|
+
"Tops": [3, 11, 5, 18, 1, 2, 4, 15, 12, 3],
|
68
|
+
"Bottoms": [1, 8, 3, 12, 1, 3, 8, 10, 8, 0],
|
69
|
+
"Inner": [3, 7, 10, 8, 2, 5, 6, 1, 0, 5],
|
70
|
+
"Shoes": [0, 2, 0, 5, 0, 1, 1, 3, 0, 0],
|
71
|
+
}
|
72
|
+
)
|
73
|
+
|
74
|
+
df = df.set_index("Store")
|
75
|
+
|
76
|
+
axes = df.plot(kind="bar", figsize=(10, 15), subplots=True)
|
77
|
+
|
78
|
+
# 図の縦方向のスペース調整
|
79
|
+
axes[0].get_figure().subplots_adjust(hspace=0.5)
|
80
|
+
|
81
|
+
for ax in axes:
|
82
|
+
# タイトルを消す
|
83
|
+
ax.set_title("")
|
84
|
+
# ラベルを下に表示
|
85
|
+
ax.tick_params(labelbottom=True)
|
86
|
+
# ラベルを回転
|
87
|
+
for tick in ax.get_xticklabels():
|
88
|
+
tick.set_rotation(90)
|
89
|
+
```
|
90
|
+
|
91
|
+

|
1
s
answer
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
`df.plot()` は作成した図 (Axes) をリストで返します。
|
2
|
+
その各 Axes に対して、以下を呼び出すと
|
1
3
|
`Axes.set_xticks([])` で major の目盛り
|
2
4
|
`Axes.set_xticks([]. minor=True)` で minor の目盛り
|
3
|
-
を
|
5
|
+
を消せます。
|
4
6
|
|
5
7
|
[matplotlib - 目盛、目盛のラベル、グリッドの設定方法について](https://pystyle.info/matplotlib-ticks-and-grid/#outline__3)
|
6
8
|
|