python - Matplotlib Errorbar Caps Missing -


i'm attempting create scatter plot errorbars in matplotlib. following example of code looks like:

import matplotlib.pyplot plt import numpy np import random  x = np.linspace(1,2,10) y = np.linspace(2,3,10) err = [random.uniform(0,1) in range(10)]  plt.errorbar(x, y,        yerr=err,        marker='o',        color='k',        ecolor='k',        markerfacecolor='g',        label="series 2",        capsize=5,        linestyle='none') plt.show() 

the problem plot output contains no caps @ all! enter image description here

for it's worth, i'm on ubuntu 13.04, python 2.7.5 |anaconda 1.6.1 (64-bit)|, , matplotlib 1.2.1.

could hidden rcparam needs overwritten?

what worked me adding (as per: how set line width of error bar caps, in matplotlib):

(_, caps, _) = plt.errorbar(x,y, yerr=err, capsize=20, elinewidth=3)  cap in caps:     cap.set_color('red')     cap.set_markeredgewidth(10) 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -

python - Received unregistered task using Celery with Django -