【发布时间】:2016-09-09 11:10:25
【问题描述】:
我以这种方式在图表中创建图例:
legend_handles.append(matplotlib.patches.Patch(color=color1, label='group1'))
legend_handles.append(matplotlib.patches.Patch(color=color2, label='group2'))
ax.legend(loc='upper center', handles=legend_handles, fontsize='small')
这会导致图例项垂直堆叠(从上到下),而我想将它们从左到右水平放置。
我该怎么做?
(matplotlibv1.4.3)
【问题讨论】:
标签: python matplotlib