MATLAB Answers

How do I incorporate meaningful colorbar/colormap in a 2D plot; Having a matrix size [83,25000]

1 view (last 30 days)
SA
SA on 18 May 2021
Commented: SA on 21 May 2021
I've a matrix to plot as row vs. column. I've done with the following scripts:
yy = rand(83,25000) ;
x = 1:size(yy,1) ;
figure
hold on
for i = 1:size(yy,2)
plot(x,yy(:,i),'.')
end
colorbar
How can I insert a meaningful colorbar? Otherwise, any other ways to plot the matrix with colorbars? Can anybody suggest me. Any suggestion/help is appreciated. Thanks

Accepted Answer

KSSV
KSSV on 18 May 2021
yy = rand(83,25000) ;
x = 1:size(yy,1) ;
y = 1:size(yy,2) ;
pcolor(x,y,yy') ;
shading interp
colorbar
  8 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!