How can I plot multichannel data in 2d plot like attached image.

On x_axis I have different 128 channels. On left y_axis I have input signal and on right y_axis I have colorbars corresponding to output data. Actually output is represented as color information.

 채택된 답변

Ameer Hamza
Ameer Hamza 2018년 6월 17일
편집: Ameer Hamza 2018년 6월 17일
You can obtain something similar using pcolor(). For Example
[x, y] = meshgrid(1:128, 0:70); % 2d meshgrid
z = sort(rand(size(x))); % sample data, use your own variable
p = pcolor(x,y,z);
p.EdgeAlpha = 0;
colorbar;
I am using random data points therefore it does not look the same as your image. Note that to display white color on the plot, the corresponding element in z variable must be inf.

댓글 수: 3

Thanks a lot. It looks perfectly what I was looking for. Great job. I will update u after integrating with my real data.
Cheers,
Aamir
Hi , I tested it with my real data and its working well. Only a minor change, to display white part, is to use (nan). inf did not work for me. I attached plot with real data for other colleagues who would need it in the
future. Once again thanks a lot Ameer Hamza .
Cheers,
Aamir
You are welcome. Also thanks for correcting the mistake and attaching a real example. This might help someone in the future.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2018년 6월 17일

댓글:

2018년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by