making errorbars not clipped in matplotlib with Python
In matplotlib, most of the detailed control needs to be done through the Artists. I think this should do what you want:
import matplotlib.pyplot as plt
from random import uniform as r
x = range(10)
e = plt.errorbar(x, [r(2,10) for i in x], [r(.1,1) for i in x], capsize=8, color='r')
for b in e[1]:
b.set_clip_on(False)
plt.show()
The problem you were having is that the clip_on
keyword was being used to control the markers and not the error bars. To control the errorbars, plt.errorbar
returns a tuple, where the second item is a list of errorbars. So here I go through the list and turn the clipping off for each errorbar.