Should I always include a legend in a graph?


#1

Question

Should I always include a legend in a Matplotlib graph?

Answer

If your graph has more than one line, then you should always include a legend.

Graphs should try to be self-explanatory, and provide enough information that someone unfamiliar with it, can look at it and understand what the data represents and what each line is describing.

Including a legend removes ambiguity, and makes it easier for us to understand and work with the provided information.