【发布时间】:2015-10-16 10:20:57
【问题描述】:
我正在尝试将我自己的标签用于 Seaborn 条形图,代码如下:
import pandas as pd
import seaborn as sns
fake = pd.DataFrame({'cat': ['red', 'green', 'blue'], 'val': [1, 2, 3]})
fig = sns.barplot(x = 'val', y = 'cat',
data = fake,
color = 'black')
fig.set_axis_labels('Colors', 'Values')
但是,我收到一个错误:
AttributeError: 'AxesSubplot' object has no attribute 'set_axis_labels'
什么给了?
【问题讨论】:
标签: python matplotlib seaborn