Graphs are drawn in the corect color based on legend