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

回答(1 个)

Morten Sparre Andersen
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.
  1 个评论
Mohamed
Mohamed 2023-2-27
thanks for answer, but i belive it's a problem on the interploation
I try to remove the ligne and change the colorbar but always not a goo interpolation

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by