Hox to interplolate Griddata and set colormaps interval
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Morten Sparre Andersen
on 27 Feb 2023
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.
See Also
Categories
Find more on Colormaps 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!