Fix problem with legend if data has NaN's

If data has NaN's and plot has a legend, matplotlib throws the following
RuntimeWarning:
...\matplotlib\transforms.py:651: RuntimeWarning: invalid value
encountered in sign