matplotlib close figure added - to avoid memory leak