MATLAB Answers

How to plot like the following figure?

조회 수: 2(최근 30일)
MD AZIZ AR RAHMAN
MD AZIZ AR RAHMAN 2021년 9월 16일
댓글: Image Analyst 2021년 9월 17일
I can gnerate the reflectance for different wavelength and diameter. In excel it ends up as a table, where the top row is assigned for diameter, and the leftmost column is assigned for wavelength. The remaining cell values are the reflectance at a particular wavelength and particular diameter. I need to plot like the following figure. Please share the code

채택된 답변

Image Analyst
Image Analyst 2021년 9월 17일
data = readmatrix(xlsfileName);
imshow(data, [], 'XData', [0, 500], 'YData', [300, 1200]);
xlabel('D (nm)')
colormap(jet(256));
colorbar;
Then use text() function to overlay the words.
  댓글 수: 2
Image Analyst
Image Analyst 2021년 9월 17일
I recommend using the row and column headers. Then those can be pulled out of the data as the first row and column
data = readmatrix(xlsxFileName);
diameters = data(1, 2:end);
wavelengths = data(2:end, 1);
signal = data(2:end, 2:end);

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

추가 답변(1개)

the cyclist
the cyclist 2021년 9월 16일
I recommend looking at the MATLAB Plot Gallery, finding a figure that is close to what you need, and pulling the code from there.

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by