Improved plt.legend handling for _plot_multiple_parameters