回答編集履歴
2
d
test
CHANGED
@@ -85,3 +85,97 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
![イメージ説明](5f959f3b42d3d3e2662026922959b8b8.jpeg)
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
## 追記
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
```python
|
96
|
+
|
97
|
+
import pandas as pd
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
df = pd.DataFrame(
|
102
|
+
|
103
|
+
{
|
104
|
+
|
105
|
+
"Store": [
|
106
|
+
|
107
|
+
"shop1",
|
108
|
+
|
109
|
+
"shop2",
|
110
|
+
|
111
|
+
"shop3",
|
112
|
+
|
113
|
+
"shop4",
|
114
|
+
|
115
|
+
"shop5",
|
116
|
+
|
117
|
+
"shop6",
|
118
|
+
|
119
|
+
"shop7",
|
120
|
+
|
121
|
+
"shop8",
|
122
|
+
|
123
|
+
"shop9",
|
124
|
+
|
125
|
+
"shop10",
|
126
|
+
|
127
|
+
],
|
128
|
+
|
129
|
+
"Guest": [45, 132, 78, 154, 39, 57, 83, 117, 96, 44],
|
130
|
+
|
131
|
+
"Outer": [0, 4, 1, 5, 0, 1, 0, 8, 2, 0],
|
132
|
+
|
133
|
+
"Tops": [3, 11, 5, 18, 1, 2, 4, 15, 12, 3],
|
134
|
+
|
135
|
+
"Bottoms": [1, 8, 3, 12, 1, 3, 8, 10, 8, 0],
|
136
|
+
|
137
|
+
"Inner": [3, 7, 10, 8, 2, 5, 6, 1, 0, 5],
|
138
|
+
|
139
|
+
"Shoes": [0, 2, 0, 5, 0, 1, 1, 3, 0, 0],
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
)
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
df = df.set_index("Store")
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
axes = df.plot(kind="bar", figsize=(10, 15), subplots=True)
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
# 図の縦方向のスペース調整
|
156
|
+
|
157
|
+
axes[0].get_figure().subplots_adjust(hspace=0.5)
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
for ax in axes:
|
162
|
+
|
163
|
+
# タイトルを消す
|
164
|
+
|
165
|
+
ax.set_title("")
|
166
|
+
|
167
|
+
# ラベルを下に表示
|
168
|
+
|
169
|
+
ax.tick_params(labelbottom=True)
|
170
|
+
|
171
|
+
# ラベルを回転
|
172
|
+
|
173
|
+
for tick in ax.get_xticklabels():
|
174
|
+
|
175
|
+
tick.set_rotation(90)
|
176
|
+
|
177
|
+
```
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
![イメージ説明](3c504a417e0b18d099ed54e72fd4680a.jpeg)
|
1
s
test
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
`df.plot()` は作成した図 (Axes) をリストで返します。
|
2
|
+
|
3
|
+
その各 Axes に対して、以下を呼び出すと
|
4
|
+
|
1
5
|
`Axes.set_xticks([])` で major の目盛り
|
2
6
|
|
3
7
|
`Axes.set_xticks([]. minor=True)` で minor の目盛り
|
4
8
|
|
5
|
-
を
|
9
|
+
を消せます。
|
6
10
|
|
7
11
|
|
8
12
|
|