Hox to interplolate Griddata and set colormaps interval
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm trying to analyze hardness mesaurement where i get three vector x,y and h
and I want to plot a map from these data (file attached) and choosing the colormaps interval.
I'am trying with this code
%% Read data
M = readmatrix('E_2022_11Cr_ODS_03.csv');
%% Get data from csv file
x1 = M(:, 1);
y1 = M(:, 2);
d1 = M(:, 3);
%% plot hardness maps
%Create regular grid across data space
n=100;
[X,Y] = meshgrid(linspace(min(x1),max(x1), n), linspace(min(y1),max(y1)), n);
g1 = griddata (x1,y1,d1, X,Y, 'cubic');
c1 = contourf(X,Y,g1 )
But i have a bad interpltation compared to map given by the hardness machine (see figures below)
Could any one helop me with these please
map with matlab
thanks in advanced
0 个评论
回答(1 个)
Morten Sparre Andersen
2023-2-27
Your map looks fine. You see more less the features as in the plot designed by the machine.
if you use functions: image or imagesc you would get images without contours resambling the map by the machine.
You change the color map with a function: colormap, and you can get a color bar with the function colorbar.
good luck
----
When you have some free time use "help graphics" in the command window to get a list of a lot of nice graphics functions. I'm sure you wil find wonderfull fnctionalities that you can't wait trying out.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!