I'm trying to make the labels for a legend have the same alignment as with the print
function. I have found this answer and others, that use leged(prop={'family':'monospace'}
:
Text alignment using format in matplotlib legend
The labels have been made with the format method: label='{:<8}{:<8}'.format(iso, 'n='+str(isotope_dict[iso]))
However, while the alignment now works, the font is changed, which doesn't look good for several figures side by side:
With legend()
With legend(prop={'family': 'monospace'})
So, is it possible to get the desired alignment, but with the same default font the legend()
uses?