1
votes

I am plotting 2D (mxn) matrix data in MATLAB with plot command.

plot(DATA,'.') plots the columns of DATA versus the index of each value. Thus, it threats each column as independent series.

However, I have problems to plot 1xm data. For my problem an 1xm data stands for m series at 1.plot(DATA,'.') does not work for this case, because it works same as plot((1:m),DATA,'.').

I have tried plot (ones(1,m),DATA,'.'), which puts points at correct locations, but it does not treat each column as new series and legend displays only one series. Any idea for the solution?

1

1 Answers

0
votes

I can propose to use following trick: create 2xm data using copy of your initial column and use ones(2,m) as index matrix:

plot(ones(2, m), repmat(DATA, 2, 1), '.')