【发布时间】:2015-07-24 04:43:26
【问题描述】:
我想在图例中的线条周围加上阴影,如下图所示。
我尝试使用类似以下内容的“孵化”:
handles, labels = ax0.get_legend_handles_labels()
handles[0] = mpatches.Patch(facecolor='red', edgecolor='red', alpha=1.0, linewidth=0, label="Theory (MLL)", hatch='-')
handles[i].set_facecolor('pink')
first_legend = ax0.legend(handles, labels, loc=0, frameon=0, borderpad=0.1)
ax = ax0.add_artist(first_legend)
但这会导致矩形有多条线,如下所示:
【问题讨论】:
标签: python matplotlib plot legend