我正在使用以下代码构建一个seaborn图形:
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
%matplotlib inline
df=pd.DataFrame(data=['a','b','c','d','a','a','b','c','a','a'],columns['datos'])
tabla=df['datos'].value_counts().reset_index()
fig, ax1 = plt.subplots(figsize=(6,4))
sns.set()
sns.barplot(x='index', y='datos', data=tabla, ax=ax1)
它确实可以正常工作...但是我该如何获取每个条形图使用的颜色代码? 我已经尝试过使用:
f.get_color()
ax.get_color()
但是完全没有成功...
提前感谢 waly