Matplot close in python thread

I have problem in closing matplot in python thread. I’m going to close python matplot with plt.close command in python thread. This command doesn’t perform and plot hangs till the end of thread

Can you provide the smallest program that shows the problem?