<p>好吧,首先,您的表不是一个整齐的格式(参见这里:<a href="http://vita.had.co.nz/papers/tidy-data.pdf" rel="nofollow noreferrer">http://vita.had.co.nz/papers/tidy-data.pdf</a>)。在</p>
<p>使您的表格保持整洁(或长)格式有一个巨大的优势,即使用seaborn绘图变得非常容易(除其他优点外):</p>
<pre><code>df # yours
name accuracy sensitivity specificity precision
0 perceptron 0.820182164169 0.852518881235 0.755172413793 0.875007098643
1 DecisionTreeClassifier 1.0 1.0 1.0 1.0
2 ExtraTreesClassifier 1.0 1.0 1.0 1.0
3 RandomForestClassifier 0.999796774253 0.999889340748 0.999610678532 0.999806362379
</code></pre>
<p>将其转换为长格式(或整齐):</p>
^{pr2}$
<p>然后,只需在一行+2行中绘制您想要的内容,以使其更清晰:</p>
<pre><code>g = sns.factorplot(data=df2,
kind="bar",
col="variable", # you have 1 plot per variable, forming 1 line and 4 columns (4 different variables)
x="name", # in each plot the x-axis will be the name
y="value", # the height of the bar
col_wrap=2) # you actually want your line of plots to contain 2 plots maximum
g.set_xticklabels(rotation=90) # rotate the labels so they don't overlap
plt.tight_layout() # fit everything into the figure
</code></pre>
<p><a href="https://i.stack.imgur.com/lqa74.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lqa74.png" alt="multiple barplot"/></a></p>
<p>高温</p>