smooth contour lines in a slice

20 vues (au cours des 30 derniers jours)
Simona Gabrielli
Simona Gabrielli le 5 Déc 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')

Réponses (1)

KSSV
KSSV le 5 Déc 2022
REad about interp2, imresize
  1 commentaire
Simona Gabrielli
Simona Gabrielli le 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!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by