smooth contour lines in a slice

24 views (last 30 days)
Simona Gabrielli
Simona Gabrielli on 5 Dec 2022
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')

Answers (1)

KSSV
KSSV on 5 Dec 2022
REad about interp2, imresize
  1 Comment
Simona Gabrielli
Simona Gabrielli on 9 Jan 2023
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!

Sign in to comment.

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!