Ensures the legend is displayed on the plot