How to plot like the following figure?

1 次查看(过去 30 天)
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 个评论
MD AZIZ AR RAHMAN
MD AZIZ AR RAHMAN 2021-9-17
Can you please share how should be the data arrangement in excel file?
I have data like
wavelength\diameter : 0 100 200 300 400 500
1200 - - - - - -
1100 - - - - - -
...
.
In this format. should the wavelength and diameter values are selected while importing from excel file? or only the reflactance values marked by ' - '?
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.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by