I have a number of lines (60 in total) that I want to build in the same figure to show the evolution of time for a particular process. The lines are currently being constructed so that the earliest time step is applied 100% red, the last time step is applied 100% blue, and the time steps in the middle are a mixture of red and blue depending on the time in which they are located (amount of red decreases linearly with increasing time, and the amount of blue increases linearly with increasing time, a simple color gradient). I would like to make a (preferably vertical) color bar of some kind that shows it in a continuous way. I mean, I want the bottom panel to have a red bar, blue on top, and some kind of red and blue in the middle of the panel that smoothly transitions from red to blue in the same waylike lines I will speak. I also want to put the axes on this color bar so that I can show which color corresponds to that time value.
I read the documentation for matplotlib.pyplot.colorbar()but could not figure out how to do what I wanted to do without using one of the matplotlib color maps defined earlier. I assume that I will need to define my own color palette, which will go from red to blue, and then it will be quite simple to pass this on matplotlib.pyplot.colorbar()and get the color panel that I want.
Here is an example of the code that I use to build strings:
import numpy as np
from matplotlib import pyplot as pp
x=
for j in range(start_time,end_time+1):
y =
red = 1. - (float(j)-float(start_time))/(float(end_time)-float(start_time))
blue = (float(j)-float(start_time))/(float(end_time)-float(start_time))
pp.plot(bin_center,spectrum,color=(red,0,blue))
pp.show()
EDIT:
Maybe it will become clearer what I mean. Below is my figure:

x y . - , - , , . , ( , ), () , ?