matplotlib show() not working. chart windows opens for 1second and closes automatically

I’m trying to plot a chart using matplotlib in python 3.10.5 but as soon as i run my code it generated the chart in a new windows and closes within seconds. Here is my function: def plot_all(levels, df): fig, ax = plt.subplots(figsize=(16, 9)) candlestick_ohlc(ax,df.values,width=0.6, colorup=’green’, colordown=’red’, alpha=0.8) date_format = mpl_dates.DateFormatter(‘%d %b %Y’) ax.xaxis.set_major_formatter(date_format) for level… Read More matplotlib show() not working. chart windows opens for 1second and closes automatically