smooth contour lines in a slice

12 visualizzazioni (ultimi 30 giorni)
Simona Gabrielli
Simona Gabrielli il 5 Dic 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')

Risposte (1)

KSSV
KSSV il 5 Dic 2022
REad about interp2, imresize
  1 Commento
Simona Gabrielli
Simona Gabrielli il 9 Gen 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!

Accedi per commentare.

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by