data_m = np.array([1, 2, 3, 4])
data_df = np.array([5, 6, 7, 8])
data_sd = np.array([11, 12, 12, 14])
import matplotlib.pyplot as plt
plt.errorbar([0, 1, 2, 3], data_m, yerr=ss.t.ppf(0.95, data_df) * data_sd)
plt.xlim((-1, 4))
How to visualize 95% confidence interval in matplotlib?