# Plotting using 'colorbar' in MATLAB [closed]

I am trying to plot a figure similar to the one attached here,I tried searching how to do a similar kinds of plot and i found about 'colormap','colorbar' in MATLAB.

Actually I want to plot this situation -

There are $1000$ cars indexed by $i=1,2,3,...,1000$ and the position changes as a function of time,now i plot index versus time and the pair(time,index) plots a value(here a colour) that is position.

But I am unable to find similar kind of plotting technique, any example on how to do this kind of plots in MATLAB or reference would be very much helpful.

• What do you mean by "searching on a plot"? What are you planning to do? Why is the colorbar not helping? Oct 7 '17 at 13:48