Horizontal layout of patches in legend (matplotlib) : <p>I create legend in my chart this way:</p>

<pre><code>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')
</code></pre>

<p>This results in the legend items stacked vertically (top-bottom), while I would like to put them horizontally left to right.</p>

<p>How can I do that?</p>

<p>(<code>matplotlib</code> v1.4.3)</p>
