python
1from itertools import product
2
3import numpy as np
4import matplotlib.pyplot as plt
5
6left = np.array([1, 2, 3, 4, 5])
7height = np.array([100, 200, 300, 400, 500])
8yerr = np.array([10, 20, 30, 40, 50])
9
10fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(16,9))
11ax_lst = list(axes.ravel())
12
13for (elinewidth, capthick), ax in zip(product([1,10], [1,10]), ax_lst):
14 ax.bar(left, height, yerr=yerr, ecolor="black", error_kw={"elinewidth":elinewidth, "capthick":capthick}, capsize=10)
15 ax.set_title("elinewidth:{0} capthick:{1}".format(elinewidth, capthick))
16
17plt.savefig("sampleimg.png")
このへん参考にしてください。
matplotlib.pyplot.bar — Matplotlib 2.2.2 documentation
matplotlib.axes.Axes.errorbar — Matplotlib 2.2.2 documentation