【发布时间】:2015-08-10 00:39:42
【问题描述】:
我想使用seaborn.tsplot 创建一个时间序列图,就像在this example from tsplot documentation 中一样,但是图例移到了右侧,在图之外。
根据seaborn's timeseries.py 中的第 339-340 行,seaborn.tsplot 目前似乎不允许直接控制图例放置:
if legend:
ax.legend(loc=0, title=legend_name)
是否有 matplotlib 解决方法? 我正在使用 seaborn 0.6-dev。
【问题讨论】:
-
我想如果你再次调用
ax.legend它会重新绘制它,而不是添加第二个。 -
这个answer的副本。
标签: python matplotlib seaborn