re-gen legend: Fixed crash on no previous legend


https://github.com/anykraus/matplotlib/commit/07930c02dd1801f7eff0b4df6a14a587e3a74112