I want Python 3 to wait till the plot was displayed before the print statement is executed. Right now it looks like that:

This is the relevant part of my code:
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv(filename)
headers = list(df)
attribute = str(input("Which attribute would you like to analyze?\n"))
attribute_mean = df[attribute].mean()
attribute_std = df[attribute].std()
ax = df.plot.bar(x=headers[0], y=str(attribute), label=("_"+attribute))
ax.axhline(attribute_mean, color="red", label="mean")
ax.axhline((float(attribute_mean) + float(attribute_std)), color="green", label="std")
ax.axhline((float(attribute_mean) - float(attribute_std)), color="green", )
ax.legend(["mean", "+std", "-std"])
plt.ylabel(attribute)
plt.xlabel(headers[0])
plt.margins(x=0, y=0)
fig = plt.gcf()
leg = plt.legend(loc = 'upper right')
fig.show()
print("The presented data showed the following characteristic values:\n")
display(df[attribute].describe())
Is there a way to fix this?