Fix problem with legend if data has NaN's

If data has NaN's and plot has a legend, matplotlib throws a
RuntimeWarning on lines 651-654.
Solution is ignore it.