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.

enter image description here

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.

  • $\begingroup$ What do you mean by "searching on a plot"? What are you planning to do? Why is the colorbar not helping? $\endgroup$ – H. Rittich Oct 7 '17 at 13:48

The plot you have shown was probably created using imagesc. The colors were choosen with the colormap command and the color bar is shown with colorbar.

| cite | improve this answer | |
  • $\begingroup$ Yes, thanks "imagesc" helped! $\endgroup$ – BAYMAX Oct 7 '17 at 14:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.