Change capstyle for errorbars in matplotlib
问题 I would like to set the capstyle for the vertical lines of an error bar to 'round'. For example, the following code produces some points with errorbars: import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.plot([1,2,3], [2,3,4], marker='o', linestyle='None') plt.errorbar([1,2,3], [2,3,4], yerr=[1,1,1], fmt=None, linewidth=3, capsize=0) plt.xlim([0,4]) plt.show() For normal lines, I can set the cap style in the rcParams using this: plt.rcParams['lines.dash_capstyle'] = 'round' and I