我用这种方式在图表中创建图例:
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')
这将导致图例项垂直堆叠(上下),而我希望将它们水平地从左到右放置。
我该怎么做?
(matplotlib
第1.4.3版)
目前没有回答
相关问题 更多 >
编程相关推荐