긴 레이블이있는 데이터 프레임을 표시하려고합니다. 플롯은 주로 그래프로 표시되어 레이블을 표시하려고합니다. 내가 가진 :Matplotlib + Pandas = 라벨 보는 법?
new_labels = []
for i, index in enumerate(df.index):
new_label = "%s (%.2f)"%(index,df.performance[i])
new_labels.append(new_label)
fig , axes = plt.subplots(1,1)
df.sort_values(col_name).plot(kind='barh', ax=axes)
axes.xaxis.set_ticklabels(new_labels)
axes.xaxis.set_major_locator(ticker.MultipleLocator(1))
, 라벨이 표시되지 않습니다. 실제로이 값은 다음과 같습니다
new_labels
['PLS regression\n\n PLSRe (0.12)',
'Regression based on k-nea (0.44)',
'The Gaussian Process mode (0.46)',
'Orthogonal Matching Pursu (0.52)',
'An extremely randomized t (0.54)',
'RANSAC (RANdom SAmple Con (0.56)',
'Elastic Net model with it (0.66)',
'Kernel ridge regression. (0.67)',
'Cross-validated Orthogona (0.67)',
'Linear Model trained with (0.68)',
'Linear regression with co (0.68)',
'Theil-Sen Estimator (0.68)',
'Lasso linear model with i (0.69)',
'Bayesian ridge regression (0.70)'...
어떻게 내 레이블에 더 많은 공간을 제공하고, 짧은 막대가 할 수 있습니까?
가 왜'figsize'을 증가시키지? 'plt.figure (그림 크기 = (10, 10))' – spies006