Fixed the legend when graphing