How to set x-ticks and y-ticks for the Raman image?
Show older comments
I would like to set x-ticks and y-ticks labels for my Raman Intensity Ratio image. My data consists of Raman intensity ratio for each coordinate of X axis and Y- axis.
The Raman intensity ratio data was collected in step size of 20µm. The X-axis starts from -195 µm till 204µm. The Y-axis -122µm to 137µm. I have attached an image of the result. I am not able to see the xticks and y-ticks on the image.
Also would it be possible to get the coordinate value from the image? I am intrested in the coordinate which are red in color. This would help me to get a Raman Intensity vs Wavenumber for a particular coordiante.
clear all
clear vars
%Loading data
Raman_Ratio=readtable("Raman Intensity Ratio.xlsx");
%Define variables
X_start=Raman_Ratio{1,"X_coordinate"};
X_end=Raman_Ratio{end,"X_coordinate"};
Y_start=Raman_Ratio{:,"Y_coordinate"};
Y_end=Raman_Ratio{end,'Y_coordinate'};
X_cord=Raman_Ratio{:,"X_coordinate"};
Y_cord=Raman_Ratio{:,"Y_coordinate"};
RI=Raman_Ratio{:,"IntensityRatio"};
% Grid of coordinates for above data
xi=X_start:20:X_end;
yi=Y_start:20:Y_end;
[X,Y]=meshgrid(xi,yi);
% For finer grid of points
m_2=X_start:1:X_end;
n_2=Y_start:1:Y_end;
[X2,Y2]=meshgrid(m_2,n_2);
%Interpolating the values of Raman Ratio into the grid
Z=griddata(X_cord,Y_cord,RI,X2,Y2);
%Showing the data as image
imshow(Z)
colormap("jet")
%adding xticks and xlabels
xticks([X_start 20 X_end])
xticklabels('auto')
%Defining a colorbar
c1=colorbar;
c1.Label.String='Raman Intensity Ratio';
caxis([0.5 0.8])
Accepted Answer
More Answers (0)
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!