Clear Filters
Clear Filters

Plot time-series data

8 views (last 30 days)
Phuong Que Tran
Phuong Que Tran on 16 Apr 2024
Edited: KSSV on 16 Apr 2024
I have a 1000x501 table in which the 1st column is wavelength and the rest are the run number when I do the experiment. How can I plot it as the example below? I want the x is wavelength, y is run number and color for the value of y. Thanks~

Answers (1)

KSSV on 16 Apr 2024
Edited: KSSV on 16 Apr 2024
Let A be your table.
wavelength = A(:,1) ;
Time = 1:size(A,2)-1 ;
data = A(:,2:end) ;
h = pcolor(wavelength,Time,data') ;
h.EdgeColor = 'none' ;
xlabel('Wave length')
Also have a look on heatmap


Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!