【发布时间】:2019-01-05 20:00:04
【问题描述】:
我想从我的 seaborn 线图图例中删除标题。我尝试使用this answer 无济于事:
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
fmri = sns.load_dataset("fmri")
fig, ax = plt.subplots()
g = sns.lineplot(x="timepoint", y="signal", hue="event", data=fmri, ax=ax)
ax.legend().set_title('')
如果我尝试将标题设置为None,我会得到相同的结果。有趣的是,将标题设置为其他内容似乎会添加到现有标题的前面:
ax.legend().set_title('Something else')
看起来 seaborn 将标题视为隐藏的传奇条目。我该如何解决这个问题?
【问题讨论】:
标签: python matplotlib seaborn line-plot