I have a time series of data for which I have the quantity, y, and its error, yerr. I would now like to create a plot that shows y against phase (i.e. time / period % 1) with vertical errorbars (yerr). For this, I typically use pyplot.errorbar(time, y, yerr=yerr, ...)
However, I would like to use a colorbar/map to indicate the value of time in this same plot.
What I thus do is the following:
pylab.errorbar( phase, y, yerr=err, fmt=None, marker=None, mew=0 )
pylab.scatter( phase, y, c=time, cmap=cm )
Unfortunately, this will plot unicolored errorbars (default is blue). Since I have ~1600 points per plot, this makes the colormap of the scatter plot disappear behind the error bars. Here's a picture shows what I mean:
Is there a way that I can get the error bars to be plotted using the same colormap as the one used in the scatter plot? I don't want to call errorbar 1600 times...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…