Building time series with different colors

I want to build some data time series where each data point has a label.

So let's say my time series has 365 points. I want to build these 365 dots with their respective colors. They are not spatial points. Therefore, I can only have a line in which line segments can have different colors.

+4
source share
1 answer

check the 3D color chart and / or color line or scatter plot as from file sharing.

or if you want to do it yourself, you can use surface :

 x=linspace(-10,10,256); y=sin(x); c=1:numel(x); colormap(jet(256)); % or whatever colormap you want surface('XData', [x(:) x(:)],'YData',[y(:) y(:)],... 'ZData',0*[x(:) x(:)],'CData',[c(:) c(:)],'EdgeColor','flat'); 

enter image description here

Read more about surface properties here .

+7
source

Source: https://habr.com/ru/post/1501763/


All Articles