0
次は、棒グラフを生成するための私のPythonコードです:、xticksが重なっなっている出力でPythonのmathplotlib - xticks内のテキストを重ねるとyticksにパーセント記号を追加
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
objects = ('Increasing operational efficiency',
'Informing strategic direction',
'Better customer service',
'Identifying and developing new products',
'Enhanced customer experience',
'Identifying new markets',
'Faster go to market',
'Complying with regulations',
'Other')
y_pos = np.arange(len(objects))
performance = [51, 36, 27, 24, 20, 11, 8, 6, 3]
plt.bar(y_pos, performance, align='center', alpha=0.5)
plt.xticks(y_pos, objects)
plt.show()
克服する方法がありますそれ。私の2番目の疑問は、値が0から60までの間隔で10の値をとっているyticksで、0%、10%、...、60%のような数字と一緒に '%'記号を追加する方法がある10、0より、...、60
は、私はあなたが簡単な検索でのご質問を見つけただろう
@Dizietがありがとうございますが、ウィンドウ内に収まるラベルはほとんどありません。ウィンドウを拡張する方法はありますか? – Jeril
ウィンドウを適切なサイズに自動的に展開するには、 'plt.tight_layout()'を使用します。 – Dvg25