smooth contour lines in a slice

조회 수: 12 (최근 30일)
Simona Gabrielli
Simona Gabrielli 2022년 12월 5일
댓글: Simona Gabrielli 2023년 1월 9일
Hello!
I'm creating slices of a volume and plotting also the contour lines using contourslice function. However, the lines are quite "angular", I would like to make them smoother. I've tried to use the function contourspline but as i see it works only for a 2d matrix while i have 3d matrix as an input for the model.
I've tried to use different interpolations but the contour lines are changing but still is not the result i was looking for.
Do you have any suggestion? maybe an option of contourslice that i haven't read about or another function that could help me with that.
Thanks
Part of the code, where Xx, Yy, Zz and model are 55x32x20, and mat_*_xs are 20x10.
slice1 = slice(ax1,Xx, Yy, Zz, model,mat_x_cs,mat_y_cs,mat_z_cs);
slice1.LineStyle = 'none';
shading interp
contours_slice=contourslice(ax1,Xx, Yy, Zz, model,mat_x_cs,mat_y_cs,mat_z_cs);
set(contours_slice,'EdgeColor','k')

답변 (1개)

KSSV
KSSV 2022년 12월 5일
REad about interp2, imresize
  댓글 수: 1
Simona Gabrielli
Simona Gabrielli 2023년 1월 9일
I've tried interp2, but it's not suitable for my data. I've obtained some improvements changing the size of the grid and the interpolation in the slices. Still not the best result but the improvement is clear.
Thanks anyway!

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

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by