フィルターのクリア

Hox to interplolate Griddata and set colormaps interval

2 ビュー (過去 30 日間)
Mohamed
Mohamed 2023 年 2 月 27 日
コメント済み: Mohamed 2023 年 2 月 27 日
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
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.
  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 Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by