matplotlib legend number columns code example
Example: matplotlib legend number columns
#Column of legend: ncol = nr_columns
ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.05),
ncol=3, fancybox=True, shadow=True)
#Column of legend: ncol = nr_columns
ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.05),
ncol=3, fancybox=True, shadow=True)