maps contourf, griddatat or scatterdata

조회 수: 1 (최근 30일)
Mohamed
Mohamed 2023년 2월 25일
댓글: Mohamed 2023년 2월 26일
Hello
I'am trying to replot may hardness mesurement that i get from the machine
I get three data vector x, y, and h
the maps that i get from the machine is like the one below
when i replot the data with matlap i get the one below
Could anyone please give me ideas how to replot the data to get better resoltion and interpolation
thanks in adavanced
  댓글 수: 2
John D'Errico
John D'Errico 2023년 2월 25일
I think too many get spoiled by tv shows and movies, where starting with a massively blurred picture about 3 pixels wide, they sharpen it in second, to then be able to read a license plate through a mirror, as well as the face of the perpetrator, complete with a tiny mole on their face and to know the color of their eyes.
Exactly what do you think should be the result of this hoped for resolution improvement? The plots you show seem reasonable, and consistent.
William Rose
William Rose 2023년 2월 25일
Great comment, @John D'Errico!

댓글을 달려면 로그인하십시오.

채택된 답변

William Rose
William Rose 2023년 2월 25일
I assume you have data at the specific points shown on the Matlab plot. If that is true, then the Matlab plot looks very good to me.
Use interp2() to interpolate your original data to a finer grid. Then use contourf() on the interpolated data set.
Since your samples do not cover a full rectangular grid, use the extrapval argument to interp2(), to specify the value to use outside the sampled area.
The sampled points are not on a grid aligned with the plotted x and y, and points in the corners and along one edge are not sampled. Therefore you will have to use the "scattered points" way of specifying the measured data when you call interp2() - see here.
Try different "methods" with interp2(): maybe you will like the visual appearance of the contours more with certain methods.
I suspect you will get good help on this if you post the data file and the code you used to generate the plot.
  댓글 수: 1
Mohamed
Mohamed 2023년 2월 26일
thanks for your answer
here is an exmple of a file that i use
and exemple of a 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');

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by