Issue creating contour plot from interpolated data
이전 댓글 표시
I've imported data into Matlab from a thermal Finite Difference which simulates the temperature profile produced on the surface of a metal plate during electron beam welding. The imported data contains the X-Y coordinates of isotherms produced during an electron beam welding process.
Because the data set I'm importing contains the coordinates of contour curves for varying temperatures (instead of an evenly distributed temperature data set) I'm having trouble producing a contour colourmap in Matlab from the data.
Image 1 - Plot of the imported data
I tried using a couple of the interpolation functions in Matlab to produce a data grid (griddata and Triscatteredinterp) but have had limited success as shown below:
Image 2 - Contourf plot of interpolated data
Image 3 - mesh plot of interpolated data
The data that is being imported is a tab delimited text file containing 3 columns of data: X, Y and the corresponding temperature for each X-Y coordinate.
I've tried removing data points to aid the interpolation but that hasn't been too successful. Is there a better way of doing this?
Thanks in advance
채택된 답변
추가 답변 (1개)
Bjorn Gustavsson
2011년 6월 8일
Since the curves are isoterms you should not be far away from a contour plot. Here I'm just assuming that you get the curves in a nice and sorted order (otherwise you'll have to do some sorting).
Temps = unique(T);
clrs = jet(length(Temps));
for i1 = 1:length(Temps),
ph(i1) = plot(X(T==Temps(i1)),Y(T==Temps(i1)));
hold on
set(ph(i1),'color',clrs(i1,:))
end
If it isn't exactly isoterms you might have to treat the temperatures with some tolerances. If you want a larger number of isoterm countours you should export them from the simulation - not invent them by interpolation.
카테고리
도움말 센터 및 File Exchange에서 Vector Volume Data에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!